Simon Peyton-Jones wrote:

| Actually, #l is just syntactic sugar for (\{l=x,...}->x), which implies | 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.

I'm not sure I parsed your sentence correctly, but in SML, (#l r) indeed *is* a function application, and #l is a perfectly normal function, as its desugared form reveals. It just fails to have a principal type (due to the lack of row polymorphism), so its type must be derivable from context - which might involve a type annotation.


BTW, I'd prefer r.l as well. A section like (.l) could then give you the equivalent of #l.

- Andreas

--
Andreas Rossberg, [EMAIL PROTECTED]

Let's get rid of those possible thingies! -- TB

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to