patch applied (haskell-prime-status): add ""Make $ left
associative, like application"
Adam Sampson
ats at offog.org
Thu Apr 24 04:53:40 EDT 2008
Simon Marlow <simonmarhaskell at gmail.com> writes:
> * add ""Make $ left associative, like application"
I'm an end user of Haskell rather than an FP researcher, and I'm very
strongly against this change because I don't think of $ as being
function application; I think of it as the "brackets from here to the
end of the expression" operator. I've always assumed that it was
defined with the associativity it currently has in order to support
that use.
As it stands, it's one of my favourite features of Haskell. I find it
particularly useful when constructing nested data structures; at the
moment, it's very easy to write something like:
Seq m $ Spec m var $ Only $ ProcCall m name args
In that case, $ clearly has the same meaning each time. If I put
something like that on a slide, I can explain the meaning of $ in a
few seconds, even to an audience who aren't familiar with functional
programming or Haskell. Forcing me to change the first two to . would
make the code harder to write, harder to understand, and harder to
explain.
If people want a left-associative application operator, then it ought
to be a new operator; please don't change the existing one.
--
Adam Sampson <ats at offog.org> <http://offog.org/>
More information about the Haskell-prime
mailing list