Merging polykinded typeable
Simon Peyton-Jones
simonpj at microsoft.com
Thu Feb 14 13:31:11 CET 2013
I'd instead do it in makeDerivSpecs
· Make the EarlyDerivSpecs as now (eqns1,2,3)
· You can easily extract which ones are for Typeable via the ds_cls field. No fancy decomposition required
· Generate more EarlyDerivSpecs for the extra Typeable instacnes you want
S
From: josepedromagalhaes at gmail.com [mailto:josepedromagalhaes at gmail.com] On Behalf Of José Pedro Magalhães
Sent: 13 February 2013 10:56
To: Simon Peyton-Jones
Cc: ghc-devs at haskell.org
Subject: Re: Merging polykinded typeable
Hi Simon,
On Sat, Feb 9, 2013 at 12:18 AM, Simon Peyton-Jones <simonpj at microsoft.com<mailto:simonpj at microsoft.com>> wrote:
Yes do point me to where the check for deriving(Typeable) is awkard to test against AutoDeriveTypeable.
I add the instances in line 319 of TcDeriv. It's easy to add them here, because I just need to
produce a simple DerivDecl. However, checking if there are instances defined already is
cumbersome, because I'd have to look at both the inst_decls and the deriv_decls, while
being careful to keep duplicates, because those are "real" errors.
In general, I find it hard to extract the class and type from an InstDecl or a DerivDecl, because
these are just HsTypes in the end, so I'd have to go deconstruct the HsType and hope it would
have the right shape. But maybe there are some auxiliary functions that I missed?
Thanks,
Pedro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130214/78206a5b/attachment-0001.htm>
More information about the ghc-devs
mailing list