>> 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 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe