[Haskell] Per-type function namespaces (was: Data.Set whishes)

Simon Peyton-Jones simonpj at microsoft.com
Thu Mar 4 10:03:38 EST 2004

| So there is no sub-typing, no row polymorphism, no attempt to give
| 	f r = r.x
| a fancy type that makes f applicable to any record with an x field.
| On the other hand, there is also no problem with many records having
| same field name either, which is the problem we started with.  There
| no implicitly-defined record selectors either: you have to use pattern
| matching for that.

Andreas says:

| Actually, #l is just syntactic sugar for (\{l=x,...}->x), which
| that you might need type annotations.

Yes I was wrong to say that there are no implicitly-defined record
selectors; (#l r) is exactly that.  Syntactically I'd prefer (r.l); but
regardless, it's a syntactic construct distinct from function
application, which must be monomorphic.  Yes, that's a kind of
interaction between binding and type system (of the kind I objected to)
but a very weak and well-behaved kind of interaction. 


More information about the Haskell mailing list