Just for your fun and horror

Matthias Felleisen matthias@rice.edu
Fri, 16 Feb 2001 09:51:35 -0600 (CST)


The problem is Haskell, not your student. 

Haskell undermines the meaning of 'return', which has the same meaning in
C, C++, Java, and who knows whatelse.  These languages use 'return' to
refer to one part of the denotation of a function return (value) and
Haskell uses 'return' to refer to two parts (value, store). These languages
have been around forever; Haskell came late. These languages are
imperative; Haskell is a wanna-be imperative language. 

The students know C'ish stuff (and I take it some Scheme); you teach
Haskell to introduce them to functional and denotational thinking.  That's
laudable. It's great. Just don't expect your students to change deeply
ingrained habits such as the 'return habit' in a few weeks. Instead, teach
explicit store-passing style and do it again and again and again until they
ask "isn't this a pattern that we should abstract out". Then show monads
and apologize profusely for the abuse of the return syntax in Haskell. If
they don't ask, chew them out near the end of the semester for being bad
programmers who can't see a pattern when it bites their b...d. Not worth
the money. Fired. 

:-)

-- Matthias