2012/2/20 José Pedro Magalhães <j...@cs.uu.nl>: >> >> >> One last issue: Say I have a type like: "data T = C !Int" >> Currently GHC Generics can't express the strictness annotation. This >> means that your deepseq will unnecessarily evaluate the Int (since it >> will always be evaluated already). It would be nice if the strictness >> information could be added to the K1 type. (José, would it be hard to >> add this to GHC.Generics?) > > > I don't think so; I think the right place to put it is as a method of the > Selector class, though. > > But, I'm wondering, for your example, wouldn't/couldn't GHC optimize away > `seq` calls to strict arguments?
Isn't it also an issue that bang patterns only guarantee WHNF, but there might be unevaluated data "further inside"? Obviously not a problem for !Int; I don't know if the logic is there to tell the difference. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe