[Haskell-cafe] Re: Referential Transparency and Monads

Eugene Kirpichov ekirpichov at gmail.com
Fri Apr 10 03:33:58 EDT 2009


2009/4/10 Stefan Monnier <monnier at iro.umontreal.ca>:
>>>>> 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.
>

Why? They both return _|_, which is a quite legal value of that type.

>
>        Stefan
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru


More information about the Haskell-Cafe mailing list