[Haskell-cafe] Derving NFData via Generics from a type that has a vector doesn't work. (was trying to understand out of memory exceptions)

Andres Löh andres at well-typed.com
Wed Apr 17 07:51:40 CEST 2013


Hi Anatoly.

I don't think that the normal deepseq package currently provides
generic deriving at all. This doesn't have anything to do with vector.
There's a default implementation for rnf that defines it to be seq,
which is not what you want in this case, of course. There are
additional packages that implement such functionality, though.

By using deepseq-generics, you can import Control.DeepSeq.Generics and
then define

> instance NFData Simple where rnf = genericRnf

Cheers,
  Andres

-- 
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com



More information about the Haskell-Cafe mailing list