[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] Re: what is inverse of mzero and return?
From:       ajb () spamcop ! net
Date:       2005-01-25 5:23:39
Message-ID: 20050125002339.cez9jjwqo04o0484 () webmail ! spamcop ! net
[Download RAW message or body]

G'day all.

Quoting Daniel Fischer <daniel.is.fischer@web.de>:

> The sad truth is that IO actions in general aren't well defined entities
> (unless we index them with the space-time-coordinates of their invocation).

Not really.  One of the ways that IO used to be implemented (still might
be on some Haskell systems) was as a term language which was effectively
interpreted by the run-time system.  You could, in principle, define Eq
on such a term language, assuming that there weren't any non-Eq values
in subterms.  So the question is relevant.

> If you cannot agree, I have another question: is
>
> return 4 >> return 5 == return 5
>
> true in the IO-Monad?

It sure is:

     return 4 >> return 5
  == return 4 >>= \x -> return 5         (defn of >>)
  == (\x -> return 5) 4                  (return-bind law)
  == return 5

Now what was the question again?

Cheers,
Andrew Bromage

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic