Mutually recursive modules and derived instances of Data
Carsten Schultz
carsten at codimi.de
Wed Oct 13 09:30:38 EDT 2004
Hi Simon!
On Wed, Oct 13, 2004 at 01:21:26PM +0100, Simon Peyton-Jones wrote:
> Two fixes suggest themselves
>
> 1. Separate 'deriving' from the data type decl, so you can say
> derive( Data TA, Typeable TA )
> anywhere. People sometimes ask for this for other reasons.
Good thing. Plus, allow to hook in Template Haskell at some point, so
that
import DeriveMyClass
derive(MyClass TA)
is equivalent to
import DeriveMyClass
$( deriveMyClass (reifyDecl TA) )
(or whatever the TH-syntax will be at that point :-) Then
data TA = ...
deriving (MyClass)
should also be possible. The advantage would be that only the module
defining the deriving would have to know about TH, not the one using
it. On other systems, the deriving could then be realized via a
pre-processor or similar means.
Greetings,
Carsten
--
Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin
http://carsten.codimi.de/
PGP/GPG key on the pgp.net key servers,
fingerprint on my home page.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/glasgow-haskell-users/attachments/20041013/c3925550/attachment-0001.bin
More information about the Glasgow-haskell-users
mailing list