[Template-haskell] Re: template haskell (reify bug and existentials)

Ian Lynagh igloo at earth.li
Tue Nov 2 22:35:04 EST 2004


[Existentials should work in the CVS head now]

On Tue, Nov 02, 2004 at 12:18:51PM +0000, Keean Schupke wrote:
> Ian, What are the chances of getting fundeps added to class declarations?
> I only need to generate them so support in the syntax and pretty-printer
> is all that is required... Here are the changes I have made to my local copy
> to get it working. I suppose this breaks existing code! Perhaps you would
> rather have a new constructor for classes with fundeps?

We have so far taken the attitude that it is better to get a cleaner
interface than to protect old code, so I think the same principle should
apply here.

> in Syntax.hs:
>    ...
>    type Fundep = ([Name],[Name]) -- add to export list

Experience has suggested that

data Fundep = FunDep [Name] [Name]

is more convenient as it allows you to make class instances for it.

>    | ClassD Cxt Name [Name] [Dec] [Fundep]

I think

ClassD Cxt Name [Name] [Fundep] [Dec]

is nicer as it matches the concrete syntax order.


Has anyone got any objections to this (in particular the breaking
existing code aspect)?


Thanks
Ian



More information about the template-haskell mailing list