Re: access to fields in nested records

2003-11-05 Thread Hal Daume III
I think the following notation is all you need: let x = DRoom 5 7 8 (DTable 1 2) y = x { square = 6, diningTable = diningTable x { tableSquare = 1 }} in ... - Hal On Wed, 5 Nov 2003, Serge D. Mechveliani wrote: Dear Haskellers, My question is about a nice way to provide a

RE: access to fields in nested records

2003-11-05 Thread Tim Docker
One thing that bugs me about the named record syntax, is that with a datatype: data T = T { t_f1 :: X, t_f2 :: X }; the function t_f1 has the type of an accessor, ie t_f1 :: T - X but there doesn't any tidy way to get at the mutator function t_f1' :: X - T - T without

RE: access to fields in nested records

2003-11-05 Thread Hal Daume III
DRiFT will let you do that, by deriving get_ and set_ methods, but other than that, no. THere was discussion about a year ago (I think) about this, with proposed syntax for something, but it never really got off the ground. You can probably google for it with my name and some other keywords

Re: access to fields in nested records

2003-11-05 Thread Robert Ennals
DRiFT will let you do that, by deriving get_ and set_ methods, but other than that, no. THere was discussion about a year ago (I think) about this, with proposed syntax for something, but it never really got off the ground. You can probably google for it with my name and some other

RE: access to fields in nested records

2003-11-05 Thread Tim Docker
(Apologies for previous incomplete post: Here's the whole thing) One thing that bugs me about the named record syntax, is that with a datatype: data T = T { t_f1 :: X, t_f2 :: X }; the function t_f1 has the type of an accessor, ie t_f1 :: T - X but there doesn't any tidy way