deepseq: instance NFData (a -> b)

Herbert Valerio Riedel hvriedel at gmail.com
Sun May 1 15:00:53 UTC 2016


On 2016-05-01 at 16:51:45 +0200, Boespflug, Mathieu wrote:

[...]

> This instance doesn't make much sense (to me at least) and is pretty
> problematic for apps that use NFData constraints as evidence that
> values are ground and fully evaluated (hence don't capture arbitrary
> resources). In HaskellR we use NFData constraints to make sure only
> fully evaluated ground data escapes the scope of a region. But
> functions are not a first-order values. They can leak arbitrary
> resources out of the scope of a region.

Are the recently added NFData instances for IORef/MVar problematic as
well?

-- hvr


More information about the Libraries mailing list