[Haskell-beginners] Recursive Let
Thomas Davie
tom.davie at gmail.com
Wed Feb 11 03:34:54 EST 2009
On 11 Feb 2009, at 09:29, Brent Yorgey wrote:
>>
>> Good. I'm not ready for _|_ yet .. :-)
>
> There's actually nothing all that difficult about _|_; it is the value
> of divergent computations--i.e. infinite recursion which never
> actually produces any data. We usually also say that anything which
> results in a run-time error is _|_. For example, each of the following
> is _|_:
>
> undefined
> error "blarg"
> let x = x in x
> let y = y + 1 in y
Note though that it's not the value of divergent computations, but
instead of divergent computations that also never produce any output.
For example, this divergent computation is not _|_, because it
produces values:
ones = 1 : ones
More precisely, in haskell bottom is a value in every type which we
can give no information about at all.
In mathematics, bottom is a value which contains the *least*
information of any value in the set, this is true in Haskell also, but
also guarenteed by the fact that types are extended to include a
special "I know nothing at all" value.
Bob
More information about the Beginners
mailing list