[Haskell-cafe] One liner?

Mitchell, Neil neil.mitchell.2 at credit-suisse.com
Thu Oct 2 11:35:14 EDT 2008


> main = do dc <- getDirectoryContents "./foo/"
>           mapM_ putStrLn dc
> 
> Translating out the do notation
> (http://www.haskell.org/haskellwiki/Keywords#do):
> 
> main = getDirectoryContents >>= \dc ->
>        mapM_ putStrLn dc

Woops, I lost "./foo/" here, but it should be fairly easy to insert
through the remaining translations.

Thanks

Neil

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================



More information about the Haskell-Cafe mailing list