[Haskell-cafe] Re: foreach

Benjamin Franksen benjamin.franksen at bessy.de
Mon Sep 18 17:31:43 EDT 2006


Brandon Moore wrote:
> Couldn't '\' delimit a subexpression, as parentheses do? Would there be
> any ambiguity in accepting code like State \s -> (s, s) instead of
> requiring State $ \s -> (s, s), or taking
> 
> main = do
> args <- getArgs
> foreach args \arg -> do
> foreach [1..3] \n -> do
> putStrLn ((show n) ++ ") " ++ arg
> 
> It would be a bit odd to have a kind of grouping the always starts
> explicitly and ends implicitly, but other than that it seems pretty
> handy, harmless, and natural (I know I've tried to write this sort of
> thing often enough)

Sounds like an extremely good idea to me.

Ben



More information about the Haskell-Cafe mailing list