[Haskell-cafe] howto mix <- within do?

Larry Evans cppljevans at suddenlink.net
Fri Oct 17 08:39:34 EDT 2008


The attached code produces error:
<-- cut here --
runghc -dcore-lint do_with_assignment.proto.hs

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="
 >-- cut here--

However, similar code here:

   http://www.nabble.com/List-as-input-p19987726.html

apparently does work.  Is there some compiler option I
need to use?  The compiler is ghc:

ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2



More information about the Haskell-Cafe mailing list