
31 Aug
2007
31 Aug
'07
4:30 a.m.
Hi, I have just discovered Generics in Haskell and, writing some code with GHC, I wondered about the portability of my code. It is possible I overlooked something in the GHC documentation but I did not found a way to obtain, let say, the haskell code for the derived classes. I mean, having the following type declaration :
data Something = This | That deriving (Eq, Ord, Typeable, Data)
I can use the -fgenerics to automatically derive instances for Something. But I could wish to have the generated source code for those instances (like, I suppose, the DrIft tool does), for instance, to compile my source with another compiler, which does not support Generics. Is that possible ? Thank you, Fernand