|
Subject: Stand-alone deriving declarations added Newsgroups: gmane.comp.lang.haskell.cvs.ghc Date: 2006-10-05 08:05:00 GMT (2 years, 39 weeks, 1 day, 3 hours and 21 minutes ago) Hi all, I have just pushed some patches which add support for stand-alone 'deriving' declarations. The main motivation for this is to allow you to use the instance deriving mechanism for data types and newtypes declared in other modules, for example if you want to use generics with existing code that does not derive Typeable and Data, or want to use Show for debugging. The syntax is: deriving Class for Type and for multi-parameter type classes: deriving (Class t1 ... tn) for Type You can't derive multiple classes in a single deriving declaration, but you can have multiple deriving declarations for the same type. I have added a small section to the type system extensions part of the Users' Guide, and a number of test cases. This is a direct result of the GHC hackathon. /Björn |
|
|