
2 Jun
2005
2 Jun
'05
10:42 a.m.
Data.Generics.toConstr is non-strict at the unit type (), but the version derived (under GHC 6.4) for isomorphic types, such as One below, is strict. data One = One deriving (Typeable, Data)
toConstr (undefined :: ()) () toConstr (undefined :: One) *** Exception: Prelude.undefined
Furthermore toConstr is non-strict for a bunch of other types, see Data.Generics.Instances. To me it seems reasonable that toConstr should be strict, since bottom is not a constructor. (I'm not just nit-picking, a bug in one of my programs was caused by me thinking toConstr was strict. The bug was of course easily fixed by adding a seq, but I'd prefer consistent behaviour of toConstr.) -- /NAD