
9 Aug
2007
9 Aug
'07
2:45 p.m.
David Roundy wrote:
Several times since reading the beginning of this discussion I've wished I had the new syntax so I could write something like:
do if predicateOnFileContents (<- readFile "foo") then ...
instead of either
do contents <- readFile "foo" if predicateOnFileContents contents then ...
or (as you'd prefer)
readFile "foo" >>= \contents -> if predicateOnFileContents contents then ...
Isn't this problem, namely being forced to name intermediate results, also solved by some sort of idiom bracket sugar, maybe together with the lambda case proposal? I would prefer both very much to the proposed (<- action) syntax for the same reasons that e.g. Jules Bean nicely summarized. Cheers Ben