RE: updating labelled fields

2002-05-10 Thread Simon Peyton-Jones
| So, as it stands the proposal is to add the following pieces of sugar: | | 1) ({assignments}) becomes \x-x{assignments} | 2) x{as, field =, bs} becomes \y-x{as, field = y, bs} | 3) x{as, field, bs}becomes \f-x{as, field = f (field x), bs} ... | Assuming I can ever get

Re: updating labelled fields

2002-05-09 Thread Hal Daume III
[SNIP] I don't think this is ambigous -- do is a keyword, so no record field update can be assumed after it. Okay, I thought about it some more and I agree. So, as it stands the proposal is to add the following pieces of sugar: 1) ({assignments}) becomes \x-x{assignments} 2)

Re: updating labelled fields

2002-05-07 Thread Jorge Adriano
On Tuesday 07 May 2002 02:07, John Meacham wrote: DrIFT which i am now maintaining can derive such utility functions out of the box. just add a {-!deriving: update -} to get update functions for every labeled field in a datatype. quite useful, I have not updated the web page yet, but the new

updating labelled fields

2002-05-06 Thread Hal Daume III
Hi, I often create structures like: data MyData = MyData { foo :: ..., bar :: ..., } and most of the time i do one of two things: 1) read values from the structure, as in: let x = (foo myData) in ... 2) update values in the structure, as in: let myData' =

Re: updating labelled fields

2002-05-06 Thread Jorge Adriano
I often create structures like: data MyData = MyData { foo :: ..., bar :: ..., } That makes 2 of us :-) and most of the time i do one of two things: 1) read values from the structure, as in: let x = (foo myData) in ... 2) update values in the structure, as in:

Re: updating labelled fields

2002-05-06 Thread Hal Daume III
I just fudgeted around in the ghc source code and this doesn't seem to be a change that would require a lot of work. Briefly, the changes that would need to be made would be: 1) In the parser, change bind so that in addition to qname '=' exp you can also have

Re: updating labelled fields

2002-05-06 Thread David Feuer
On Mon, May 06, 2002, Hal Daume III wrote: I wouldn't at all mind making this addition if I had a sense that it would actually be accepted and that people weren't going to go crazy over the syntax. Would something like - be preferred or something like $=? - Hal Why not $= ?

Re: updating labelled fields

2002-05-06 Thread Jorge Adriano
On Monday 06 May 2002 23:28, Hal Daume III wrote: I wouldn't at all mind making this addition if I had a sense that it would actually be accepted and that people weren't going to go crazy over the syntax. Would something like - be preferred or something like $=? I'd still prefer having some

Re: updating labelled fields

2002-05-06 Thread John Meacham
DrIFT which i am now maintaining can derive such utility functions out of the box. just add a {-!deriving: update -} to get update functions for every labeled field in a datatype. quite useful, I have not updated the web page yet, but the new DrIFT homepage will be at