[Haskell-cafe] OPPS, missing attachment (was Re: howto mix <- within do?

Martijn van Steenbergen martijn at van.steenbergen.nl
Fri Oct 17 08:56:40 EDT 2008


Every statement in a do-expression has to be in the same monad.

You are mixing the list monad (v0 <- [999]) with the IO monad (putStr 
"v0=").

Instead of

     v0 <- [999]

try:

     let v0 = [999]

Hope this helps,

Martijn.


Larry Evans wrote:
> On 10/17/08 07:39, Larry Evans wrote:
>> The attached code produces error:
>> <-- cut here --
> [snip]
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list