Polymorphic record update

Einar Karttunen ekarttun at cs.helsinki.fi
Mon Jan 23 15:07:31 EST 2006


Here is a proposal to allow polymorphic record update for the existing
record system. I think it makes sense if the current record system is

Given a record like:

data Foo a = Foo { bar :: a }

it would be nice to be able to update it like:

f = Foo { bar = 'a' }
g = f { bar = False }

constructing the new record by hand is quite tedious for records
with many fields and one ends up writing helper functions to
do this.

- Einar Karttunen

More information about the Haskell-prime mailing list