Proposal for stand-alone deriving declarations?

Simon Peyton-Jones simonpj at
Mon Oct 9 08:19:38 EDT 2006

| > I propose to add a top-level declaration on the form:
| >
| > 'deriving' qtycls 'for' qtycon
| >
| > which produces the same instance as a deriving clause in the
| > declaration of the datatype or newtype would.
| If this is added (whatever the syntax), you'd also want to permit
| identical derived instances.

Perhaps so.  This might generate duplicate code (one for each decl) but
it'd be guaranteed identical since it's generated by a deriving clause.

It'd require some .hi file support, to record that an instance came from
a 'deriving' decl.

I'm inclined to wait until someone asks for it "for real" as it were.


More information about the Haskell-prime mailing list