Re: [Haskell] Proposal: Allow "\=" for field update in record update syntax
"S. Alexander Jacobson" <[email protected]> Mon, 28 Feb 2005 05:32:09 -0500 (Eastern Standard Time)
| Newsgroups | gmane.comp.lang.haskell.template |
|---|---|
| Message-ID | <Pine.WNT.4.62.0502280530150.760@philo> |
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