
13 Sep
2006
13 Sep
'06
4:53 a.m.
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.