[Haskell-cafe] Re: Can we come out of a monad?

Martijn van Steenbergen martijn at van.steenbergen.nl
Tue Aug 10 17:36:52 EDT 2010


On 8/10/10 23:27, Felipe Lessa wrote:
> If we had in C:
>
>    return (randomNumber(10, 15) + randomNumber(10, 15))
>
> That would not be the same as:
>
>    int x = randomNumber(10, 15)
>    return (x + x)

That's not fair. You're comparing C's '=' with Haskell's '='. But you 
should be comparing C's '=' with Haskell's '<-'.

In your Haskell example, x :: IO Int. In your C example, x :: Int.

Martijn.


More information about the Haskell-Cafe mailing list