Just for your fun and horror

Jerzy Karczmarczuk karczma@info.unicaen.fr
Mon, 19 Feb 2001 11:08:28 +0000

Dear all, at haskell-café & plt-scheme.

1. THANK YOU VERY MUCH for enlightening comments about the
   terminology, student psychology, etc. I will get back to it
   in a second, for the moment I ask you very politely:

   survey the adressee list if you "reply-all". For people
   subscribing both Haskell and Scheme forums means 4 copies
   of your message, if you send the messages simultaneously 
   to the private address of the previous author...!. 
   I thought that a cross posting might have some merits, and 
   I see now the nuisance. My deep apologies. 

2. People suggest that the word return has been badly chosen.
   I have no strong opinion, I begin to agree... we had unit,
   result, people propose liftM, compute, deliver, etc. 
   I wonder why return stuck?
   Just because it exists elsewhere? I believe not, it has some
   appeal, as Joe Fasel acknowledges.

C. Reinke writes:

> One way to look at the problem is that some of your students have 
> concrete experience with `return' in different contexts, and that
> Haskell tries to make different things look similar here. You say
> "we worked with monads for several weeks" but, you being yourself,
> this was probably at a fairly abstract and general level, right?

No, not exactly. Being myself, just the opposite.
There is *NO* more abstraction in my course than in Wadler's
* I begin with a silly functional evaluator of a tree representing
  an arithmetic expression. 
* We recognize together with the students that a program may fail,
  and we introduce Maybe. They see thus a simple monadic generali-
  sation and the first non-trivial instance of return. We try to
  implement (in a sketchy way) a tracing generalisation as well.

* They have parallelly a course of Prolog, so we play con mucho
  gusto with a few "non-deterministic" algorithms, such as standard
  combinatoric exercices : the generation of permutations, of the
  powerset, etc. On average the students seem to understand the
  idea and the implementation, and *mind you*: while writing their
  exercises <<a vista>> they duly corrected themselves when they
  were tempted to write "z" instead of "return z". ([] =-> [[]]).

* We worked for a reasonable period with monadic parsers. The 
  comment above is valid. Semantically they accepted the difference 
  between "z" and "return z". I couldn't foresee any surprises.

* They had to write a serious program in Haskell, so I gave them
  an introduction to Haskell I/O. They couldn't escape from
  *practical* Monads (although some of my students "perverted" 
  [with my approval] the idea of writing a *syntactic* converter 
  to Scheme, realizing it not in Haskell but in Scheme...)

I spoke of course about types, but not simultaneously. We took
advantage of the type inference, and the *type* of return has not
been discussed explicitly sufficiently early. This is - I believe -
my main, fundamental pedagogical fault! Yes Joe, I think this
has been my own <<pons asinorum>>.
If my compilation course survives all this affair (not obvious)
I will try to remember Jón Fairbarn's suggestion (repeated by
Manuel Chakravarty), and to discuss thoroughly the status of 
"C" imperative concepts, in order to prevent misunderstandings.

C. Reinke again:
> Unless you're one of Asimov's technicians of eternity, it is a bit
> difficult to change the history of programming languages, and assuming
> that the students pay for the opportunity to learn, you can't really
> fire them either.. 

We are all Technicians able to change the past, but since
we do not live outside the System, we do it usually in the 
Orwellian way: we change the INTERPRETATION of the past. Things
which were good (structural top-down programming) become bad
(inadapted to object approach). Strong typing? A straitjacket for
some, a salvation for the other. Scheme'ists add OO layers in
order to facilitate the code reusing, and this smuggles in some
typing. Dynamic typing in static languages became a folkloric,
never-ending issue... The history of languages is full of
"second thoughts". Who will first write a paper with a Wadlerian
style [[but taken from earlier literature]] title:

"Monads considered harmful"
"Return should NOT return its argument"


And in France students don't pay for the opportunity to learn.

Jerzy Karczmarczuk
Caen, France