Donald Bruce Stewart <dons <at> cse.unsw.edu.au> writes:

> > mainMenu =
> >    sequence_ $ map putStrLn ["line1", "line2", "line3"]
> 
> I argue if you want to sequence_ a map you should write mapM_:
> 
>     mapM_ putStrLn ["line1", "line2", "line3"]

Nice

> 
> mapM is under-appreciated? More under-appreciated are line gaps:
> 
>     main = putStr "line1\n\
>                   \line2\n\
>                   \line3\n"
> 

Or if you don't like hand writing in all the newlines you could use

   putStrLn . concat . intersperse "\n"
   



_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to