[Haskell-cafe] DeepSeq and random generators

Dennis Raddle dennis.raddle at gmail.com
Tue Jul 18 09:18:15 UTC 2017

I'm having trouble using Control.DeepSeq.force (necessary for parallel
code) on a StdGen from System.Random. I don't know how to derive NFData. A
standalone deriving statement, like this

deriving instance NFData StdGen

gets me the error "the data constructors of StdGen are not all in scope..."

Is it actually possible to derive an NFData instance of StdGen, and how
would I do that? Or if not possible, how can I work about this?

Note: I'm going to see if I can use tf-random in this application. Maybe it
will be easier.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170718/3ecfddb1/attachment.html>

More information about the Haskell-Cafe mailing list