RE: Re: [Haskell] Proposal: Allow "\=" for field update in record update syntax

"Simon Peyton-Jones" <[email protected]> Mon, 7 Mar 2005 08:39:03 -0000
Newsgroups gmane.comp.lang.haskell.template
Message-ID <036EAC76E7F5EC4996A3B3C3657D411601DBE7DD@EUR-MSG-21.europe.corp.microsoft.com>
What exactly is it that TH doesn't support, that you want?

Simon

| -----Original Message-----
| From: [email protected]
[mailto:[email protected]] On
| Behalf Of S. Alexander Jacobson
| Sent: 28 February 2005 10:32
| To: Sander Evers; [email protected]
| Subject: [Template-haskell] Re: [Haskell] Proposal: Allow "\=" for
field update in record update syntax
| 
| Since operators can't start with a ':', is there an in-principle
| reason TH does not support : operators?  The syntax below would be
| really nice to have.
| 
| 
| 
| On Fri, 18 Feb 2005, Sander Evers wrote:
| 
| >
| >> Then we could have e.g. (:=) and (:\=) and end up with a
| >> syntax that looks like this:
| >>
| >>    rec // field :\= fn . field2 := val
| >>
| >> And that is BETTER than the Haskell syntax that I originally
proposed.
| >
| > This syntax is also nice for composition of update functions, which
is useful
| > with nested records:
| >
| > data Country = Country {capital :: City, ...}
| > data City = City {inhabitants :: Int, ...}
| >
| > birth_in_capital :: Country -> Country
| > birth_in_capital = capital :\= (inhabitants :\= (+1))
| >
| > This also shows that it would be useful to make :\= associate to the
right.
| >
| 
| ______________________________________________________________
| S. Alexander Jacobson tel:917-770-6565 http://alexjacobson.com
| _______________________________________________
| template-haskell mailing list
| [email protected]
| http://www.haskell.org/mailman/listinfo/template-haskell