Jerzy Karczmarczuk wrote:
Well...
Personally I hate thinking about bottom as "value". I don't do this. I
NEVER teach that. And, I am a "lazy guy", almost all my Haskell programs
are strongly based on laziness.

I'll tell you what I teach, and you might throw some tomatoes...
"The fundamental thing that differentiates Haskell from other languages
and the source of it power" - if I might cite you - is that we don't see
the difference between an object and the process which creates it.  (The
difference demands that we speak about the call-by-need, etc...)
The bottom, as sin (2*pi), or "Text" may be seen as processes. Anyway, a
lazy list IS a process /par excellence/. The _|_ entity is a process
which refuses to give you a value (or does it in a deadly way). Your
program manipulates processes. A process in some computational context
must do something - or not. The bottom never does anything useful.

While it's ultimately an issue of nomenclature, applying the terminus "value" to _|_ is a good idea, because it allows us to answer questions like the following:

Question: What is (the denotation of, the value of)

   x = and $ take 5 $ cycle [True,False]
       where cycle xs = fix (xs++)

Answer:

   x = False

If you treat _|_ as a value, this answer can be obtained by straightforward algebraic manipulation. If you treat _|_ as an operational construct, you will have to perform graph reduction to see the answer, but then you have to worry about the *order* in which you perform your reduction steps.

It's not wrong to perform graph reduction, and any student should do it at one point in their lives, but the restriction to operational semantics would miss an important abstraction that is part of the Haskell spirit.


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


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

Reply via email to