
On Thu, 2012-02-23 at 23:24 +0100, Bas van Dijk wrote:
Some nitpicking:
* In the instance:
instance GDeepSeq U1 where grnf _ = ()
I think it makes sense to pattern match on the U1 constructor, as in: grnf U1 = ().
I haven't checked if that's necessary but my fear is that assuming: data Unit = Unit deriving Generic; instance DeepSeq Unit rnf (⊥ :: Unit) would equal: () while I would expect it to equal ⊥.
I just tested this and you were right; I have corrected the code in the mercurial repository.
* Why do you have the instance:
instance GDeepSeq V1 where grnf _ = ()
The only way to construct values of a void type is using ⊥. And I would expect that rnf ⊥ = ⊥, not (). I think the best thing is to just remove the V1 instance.
I have confirmed what Jos explained, and V1 instances are indeed not necessary for the use case I originally intended them for, that is for types tagged with void types. I have removed the V1 instance for now. Thanks, Maxime