[Haskell-beginners] A basic misunderstanding of how to program with IO

Ken Overton koverton at lab49.com
Sat May 8 11:55:09 EDT 2010

Sorry for such a beginner-y question, but is there a way to make a function like:

    interact :: String -> Resp
    interact txt =
		putStrLn txt
		rsp <- getLine
		return parseResp rsp

    parseResp :: String -> Resp

Or is that simply a wrong way of programming in Haskell with IO?

Thanks (and apologies),

-- kov

More information about the Beginners mailing list