[Haskell-cafe] Fwd: Monads, do and strictness

Roman Cheplyaka roma at ro-che.info
Sat Jan 21 23:24:57 CET 2012

* David Barbour <dmbarbour at gmail.com> [2012-01-21 12:18:09-0800]
> `undefined` is not a value in any domain. It isn't a value at all. It's
> certainly not part of my monad language or algebra. Up to the semantic
> level of comparing observable and legally defined behaviors, we can have
> the identity law. That's sufficient for the letter of the law, even if not
> ideal from Haskell's operational perspective.

First, can we please agree on what kind of semantics we are discussing?

In the beginning you are talking about domains, so it sounds like
denotational semantics. But then you move to behaviours, and that sounds
like operational semantics.

If we are talking about the denotational semantics, then we choose a
domain and need to map every legal Haskell expression to something in
that domain.

Now, 'undefined' is certainly a legal Haskell expression. If you don't
like exceptions, let's define 'undefined' as (let x = x in x).

Hence you need to have some element in your domain corresponding to

Roman I. Cheplyaka :: http://ro-che.info/

More information about the Haskell-Cafe mailing list