[Haskell-cafe] Sending bottom to his room

Luke Palmer lrpalmer at gmail.com
Sat Dec 29 06:30:03 EST 2007

On Dec 29, 2007 11:14 AM, Cristian Baboi <cristian.baboi at gmail.com> wrote:
> In The Implementation of Functional Programming Languages by S.P. Jones,
> section 2.5.3, page 32 it is written:
> Eval [[*]] a b = a x b
> Eval [[*]] _|_ b = _|_
> Eval [[*]] a _|_ = _|_
> but in section 2.5.2 it is said that _|_ is an element of the value domain.
> What business does it have on the left side of the '=' ?

I don't know the book you're talking about, but I suspect that this is not
a definition of a function in a language, but rather the denotational semantics
for a function.  Just as mathematics is allowed to categorize all
turing machines
into two categories (those that halt and those that do not), even
though to actually
do this is impossible, so too can mathematics talk about what a function returns
when given _|_, even though it is impossible in general to know when
you actually
do have _|_ or you're just waiting for a value.

However, if you saw something like this:

  Eval [[*]] a b   = a x b
  Eval [[*]] _|_ b = b
  Eval [[*]] a _|_ = a

Then you would have cause for alarm, since this is not a monotone
function (am I using
that term correctly?).


More information about the Haskell-Cafe mailing list