17 Oct
2008
17 Oct
'08
8:57 p.m.
On Fri, Oct 17, 2008 at 1:39 PM, Larry Evans <cppljevans@suddenlink.net> wrote:
do_with_assignment.proto.hs:30:2: Couldn't match expected type `[]' against inferred type `IO' Expected type: [t] Inferred type: IO () In the expression: putStr "v0=" In a 'do' expression: putStr "v0="
Prelude> let f = do { v <- [999] ; return () } Prelude> :t f f :: [()] Prelude> :t putStr "" putStr "" :: IO () So "v <- [999]" is in the list monad, but putStr is in the IO monad. The two cannot mix in that way. This looks like it might be homework so I'll refrain from saying any more for now. Good luck! D