
22 May
2010
22 May
'10
9:49 a.m.
enDataI :: (Int -> DataBox) enDataI = DataBox
enDataB :: (Bool -> DataBox) enDataB = DataBox
instance Data DataBox where gfoldl k z (DataBox d) = z DataBox `k` d gunfold k z c = (if True then k (z enDataI) else k (z enDataB))
Interesting solution but I'm not smart enough to see how the solution can be generalized to any data type that's an instance of Data. Do I have to repeat the "if then else" for every instance of the Data type class (which I can't) or is there some other way? Oscar