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