RE: [Haskell-cafe] One liner?

2008-10-02 Thread Mitchell, Neil
Hi You can translate this step by step. 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 Then we can chop out the dc argument,

Re: [Haskell-cafe] One liner?

2008-10-02 Thread Ketil Malde
Paul Keir [EMAIL PROTECTED] writes: module Main where import System.Directory (getDirectoryContents) main = do dc - getDirectoryContents ./foo/ mapM_ putStrLn dc mapM_ putStrLn (getDirectoryContents ./foo/) Couldn't match expected type `[String]' mapM_ putStrLn needs a

RE: [Haskell-cafe] One liner?

2008-10-02 Thread Mitchell, Neil
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

RE: [Haskell-cafe] One liner?

2008-10-02 Thread Paul Keir
; haskell-cafe@haskell.org Subject: RE: [Haskell-cafe] One liner? Hi You can translate this step by step. main = do dc - getDirectoryContents ./foo/ mapM_ putStrLn dc Translating out the do notation (http://www.haskell.org/haskellwiki/Keywords#do): main = getDirectoryContents = \dc