[Haskell-beginners] Question on Lazy IO

Dan Serban dserban01 at gmail.com
Thu Jul 24 07:25:58 UTC 2014


Hi Chul-Woong,

$ pwd | ./testprog
ECHO result
/tmp

Your program works as you expect if you pipe some contents via STDIN.
This is testprog.hs:
main :: IO ()
main = do
  l <- fmap lines getContents
  putStrLn "ECHO result"
  putStr $ unlines l

-Dan


More information about the Beginners mailing list