What is the error that you get?
Cheers,
Pedro
-- ok, something in deriving NFData using Generics in a type that has a Vector in it.
{-# LANGUAGE DeriveGeneric #-}import Control.DeepSeqimport System.IOimport GHC.Generics (Generic)import qualified Data.Vector as Vimport qualified Data.ByteString.Lazy.Char8 as BLscanl' :: NFData a => (a -> b -> a) -> a -> [b] -> [a]scanl' f q ls = q : (case ls of[] -> []x:xs -> let q' = f q xin q' `deepseq` scanl' f q' xs)-- this runs without blowing up-- main = print $ last $ scanl' (+) (0::Int) [0..]data Simple = Simple (V.Vector Double)deriving (Show, Generic)instance NFData Simple--this blows upmain = dolet initial = Simple $ V.fromList (take 100 $ repeat 0)sumvs (Simple a) (Simple b) = Simple $ V.zipWith (+) a bprint $ last $ scanl' sumvs initial $ repeat $ initial
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe