[Haskell] Extensible records: Static duck typing

Cale Gibbard cgibbard at gmail.com
Tue Feb 5 06:35:57 EST 2008


On 05/02/2008, Cale Gibbard <cgibbard at gmail.com> wrote:
> On 05/02/2008, Barney Hilken <b.hilken at ntlworld.com> wrote:
> >
> >         Should {label := "Hi", color := blue} and {color := blue, label :=
> > "Hi"} have the same type?
> >
>
> The scoped labels paper has an interesting feature in this regard:
> labels with different names can be swapped at will, but labels having
> the same name (which is allowed) maintain their order. The types are
> equivalent in either case though.

Er, sorry, no they're not. Two labels with the same name may have
different types, and you can't swap them at the type level either,
obviously.


More information about the Haskell mailing list