patch applied (haskell-prime-status): add ""Make $ left associative, like application"

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Apr 23 05:17:32 EDT 2008


On Tue, 2008-04-22 at 16:21 -0700, Simon Marlow wrote:
> Chris Smith wrote:
> > On Tue, 22 Apr 2008 15:53:39 -0700, Simon Marlow wrote:
> >> Tue Apr 22 15:53:31 PDT 2008  Simon Marlow
> >> <simonmarhaskell at gmail.com>
> >>   * add ""Make $ left associative, like application"
> > 
> > Is there a justification for this somewhere?
> 
> I'm hoping someone will supply some.  There seemed to be strong opinion 
> on #haskell that this change should be made, but it might just have been 
> a very vocal minority.

It true that (f $ g $ h $ x) might be nicer written (f . g . h $ x)

but I've always thought the point of $ is for things like

withSomeResource foo $
  withSomeOtherThing bar $
    yetAnotherBlockStructured thing $ ...

Does that work?

Or

withSomeResource foo $ \x ->
  withSomeOtherThing bar $ \y ->
    yetAnotherBlockStructured thing $ \z ->

Or does that case still work?

There must have been some justification for the original design or was
it just f $ g $ h $ x  ?

Duncan



More information about the Haskell-prime mailing list