[Haskell-cafe] One liner?

2008-10-02 Thread Paul Keir
Hi all, There's a common little situation I keep bumping up against. I don't understand where I'm going wrong, so I've made a little example. It's to do with binding a result to a variable name using -. This code works fine: -- module Main where

RE: [Haskell-cafe] One liner?

2008-10-02 Thread Mitchell, Neil
-suisse.com/emea/legal outbind://31/www.credit-suisse.com/emea/legal From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Keir Sent: 02 October 2008 4:20 pm To: haskell-cafe@haskell.org Subject: [Haskell-cafe] One liner

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

Re[2]: [Haskell-cafe] One liner?

2008-10-02 Thread Bulat Ziganshin
] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Keir Sent: 02 October 2008 4:20 pm To: haskell-cafe@haskell.org Subject: [Haskell-cafe] One liner? Hi all, There's a common little situation I keep bumping up against. I don't