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 wa

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 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 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 w

AW: access to fields in nested records

2003-11-05 Thread Markus . Schnell
rge D. > Mechveliani > Gesendet: Mittwoch, 5. November 2003 13:27 > An: [EMAIL PROTECTED] > Betreff: access to fields in nested records > > > Dear Haskellers, > > My question is about a nice way to provide a getting/setting &g

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 getting/se

access to fields in nested records

2003-11-05 Thread Serge D. Mechveliani
Dear Haskellers, My question is about a nice way to provide a getting/setting access to the nested record fields. Example: --- data House = House {houseNo:: Int, diningRoom :: DiningRoom