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
-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
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
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
; 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
]
[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