[Haskell-cafe] Re: Referential Transparency and Monads

Stefan Monnier monnier at iro.umontreal.ca
Fri Apr 10 03:30:34 EDT 2009


>>>> IO a  ~  World -> (a, World)
>>> I still don't understand this; we are passing a World and getting a
>>> World back,
>> We are?  Why do you think that?
> Because that's what (World -> (a,World)) means, last I checked.

No: Hasekll functions are partial, which means that "a -> b" means
"takes an object of type `a' and if it terminates, it returns an object
of type `b'".  Note the "if it terminates".

Since neither loop nor loop' terminate, their return type is
actually meaningless.


        Stefan



More information about the Haskell-Cafe mailing list