Lemmih wrote:
>  main = do
>    args <- getArgs
>    flip mapM_ args $ \arg ->
>      flip mapM_ [1..3] $ \n ->
>        putStrLn $ show n ++ ") " ++ arg

Or even:

main = do
    args <- getArgs
    putStr $ unlines [ show n ++ ") " ++ arg
                     | arg <- args, n <- [1..3] ]

I'm really at a loss trying to understand why some people seem to like
the imperative style.  In fact, most  of the time, the strings in the
code above are better replaced by Doc from Text.PrettyPrint.


Udo.
-- 
Worrying is like rocking in a rocking chair -- It gives
you something to do, but it doesn't get you anywhere.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to