
23 Apr
2008
23 Apr
'08
5:42 a.m.
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' type blocks:
Or
withSomeResource foo $ \x -> withSomeOtherThing bar $ \y -> yetAnotherBlockStructured thing $ \z ->
That should work, because '\x ->' extends to the end of the expression. Similarly: iWantMonadicValues $ do foo bar iAlsoWantMonadicStuff $ do ... still works. -- Dan