patch applied (haskell-prime-status): add ""Make $ left
associative, like application"
dan.doel at gmail.com
Wed Apr 23 05:42:20 EDT 2008
On Wednesday 23 April 2008, Duncan Coutts wrote:
> withSomeResource foo $
> withSomeOtherThing bar $
> yetAnotherBlockStructured thing $ ...
> Does that work?
This wouldn't work, you'd have to rewrite it as:
withSomeResource foo .
withSomeOtherThing bar .
yetAnotherBlockStructured thing $ ...
But it seems like your second example is more likely to come up for 'with'
> withSomeResource foo $ \x ->
> withSomeOtherThing bar $ \y ->
> yetAnotherBlockStructured thing $ \z ->
That should work, because '\x ->' extends to the end of the expression.
iWantMonadicValues $ do foo
iAlsoWantMonadicStuff $ do ...
More information about the Haskell-prime