c_stanto writes:
 > 
 > here is my code and I am guess that the problem is that openFile returns
 > an IO Handle and getContents takes just a Handle.  How do I go about
 > fixing this?  
 > 
 > 
 > module Main(main) where
 > 
 > import IO
 > 
 > main = putStrLn (getContents (openFile "./joseph.txt" ReadMode))

Hi.

Try looking at a short paper on monads.  For example, this one

  http://www.dcs.gla.ac.uk/~nww/Monad.html
  (found from http://haskell.org/bookshelf/)

introduces monadic I/O and shows why we generally can't just compose
functions when we're dealing with monads.

Regards,
Tom

Reply via email to