| 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
[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)
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
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' =
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:
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
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 $= ?
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
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