[Haskell] Extensible records: Static duck typing

Cale Gibbard cgibbard at gmail.com
Tue Feb 5 05:57:24 EST 2008

On 05/02/2008, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> saveToFile x = writeToFile "data" (show x.getValue)

Heh, I had to read this a couple times to figure out that it wasn't
just a blatant type error, and that (.) there doesn't mean function
composition. :)

On the matter of extensible records, I really like the semantics of
Daan Leijen's proposal here:

However, the syntax could use some work. Using (.) as a record
selector is out of the question. Personally, I think pt{x} for
extracting the x field of pt seems not-so-unreasonable, and meshes
well with the existing syntax for record updates.

 - Cale

More information about the Haskell mailing list