Iavor Diatchki | 29 Jan 22:25 2013
Picon

Proposal to extend FieldPat in Template Haskell

Hello,
(sorry for the repost, I forgot to add a subject.)

I was just doing some work with Template Haskell and I noticed that the AST does not have support for record puns and wild-cards.  I know that these could be desugared into ordinary record patterns but I think that it would be more convenient for users (and also more consistent with the rest of the AST) if we provided direct support for them.

So I propose to change:

type FieldPat = (Name, Pat)

to

data FieldPat = RecordFileldP Name Pat  -- x = P
              | RecordPunP Name         -- x
              | RecordWildP             -- ..

Would there be any objections to doing so?  If not, I'd be happy to have a go at making the change.

-Iavor

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Simon Peyton-Jones | 30 Jan 09:43 2013
Picon

RE: Proposal to extend FieldPat in Template Haskell

Fine with me!  We need people to update TH.

 

We plan to release 7.8 in mid Feb, and then have a TH upheaval shortly thereafter (I hope). So let’s put this in afterwards. 

 

Simon

 

From: glasgow-haskell-users-bounces <at> haskell.org [mailto:glasgow-haskell-users-bounces <at> haskell.org] On Behalf Of Iavor Diatchki
Sent: 29 January 2013 21:25
To: GHC Users Mailing List; Eric Mertens
Subject: Proposal to extend FieldPat in Template Haskell

 

Hello,

(sorry for the repost, I forgot to add a subject.)

 

I was just doing some work with Template Haskell and I noticed that the AST does not have support for record puns and wild-cards.  I know that these could be desugared into ordinary record patterns but I think that it would be more convenient for users (and also more consistent with the rest of the AST) if we provided direct support for them.

 

So I propose to change:

 

type FieldPat = (Name, Pat)

 

to

 

data FieldPat = RecordFileldP Name Pat  -- x = P
              | RecordPunP Name         -- x
              | RecordWildP             -- ..

 

Would there be any objections to doing so?  If not, I'd be happy to have a go at making the change.

 

-Iavor

 

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Gmane