[Haskell-beginners] Does System.Directory work on Windows XP?
Daniel Fischer
daniel.is.fischer at web.de
Wed Nov 4 19:59:12 EST 2009
Am Donnerstag 05 November 2009 01:14:59 schrieb Patrick Larrivee-Woods:
> With 6.10.4 it works fine. Thanks for your help, I hadn't even realized
> I was using an older version.
>
> Cheers,
> Patrick
Just to explain:
getDirectoryContents "." is an IO action producing a String.
In newer GHC releases (I don't remember whther that change came with 6.6 or 6.8), when you
invoke an IO action from the ghci-prompt, if the value returned from the action has not
type (), by default it is bound to the variable 'it' and printed out (since it's not
unconditionally a good thing to do that - consider readFile "HUGEFile.txt" - it can be
disabled via
ghci> :set -fno-print-bind-result
- re-enable with -fprint-bind-result).
Before, the action was simply run and its result not printed out, to use the result of an
IO action, you had to use
ghci> res <- getDirectoryContents "."
ghci> print res
or
ghci> getDirectoryContents "." >>= mapM_ putStrLn
or whatever.
If you still have 6.4.2 installed, you can try it out (but do your real work with the
newer, it produces better code).
>
> Jason Dusek wrote:
> > Could you try a recent version of GHC and let us know if you
> > still have trouble?
> >
> > --
> > Jason Dusek
More information about the Beginners
mailing list