[Haskell-cafe] On the verge of ... giving up!

jerzy.karczmarczuk at info.unicaen.fr jerzy.karczmarczuk at info.unicaen.fr
Sun Oct 14 14:39:34 EDT 2007


Brian Hurt writes: 

> I'm going to offer an opinion here that's likely to be controversial (in 
> this forum): people new to functional programming shouldn't learn Haskell 
> first.  

Great! So, there are at least two of us! 

> They should start with either Ocaml or SML first. 

Or Scheme.
Or *any* decent language, with functional tools. It is *exactly* what we
tried to do with Python. Paying tribute to our pedagogical constraints,
and teaching a language with a strong imperative taste, but using
functional constructions as frequently as possible. Recursion,
comprehensions, map/filter business (despite strong intentions of Guido
V.R. of killing them...), etc.
Also, higher-order functions, not so bad in Python, although sometimes
curiously inefficient. But, anyway, splitting between the language and
the basic techniques may be not so stupid.
Hm. An Anglosaxon shouldn't say "techniques may not be so stupid"?... 

I agree with what Brian says next. But...: 

> In a similiar fasion, Ocaml allows you to write old fasioned impertive 
> code when you need to just get something working.  And as you have the 
> time/inclination/need to, you can start playing with more advanced 
> functional concepts, like purely applicative data structures, lazy 
> evaluation, and even monads.

As far as the lazy evaluation is concerned, I would suggest then to jump
to Haskell or to Clean, after just a few simple-minded exercices in other
languages (the cons-stream, etc. in Scheme. Or, the generators in Python,
which are in a sense "lazy objects").
Otherwise you will *never* get a taste of laziness. It is useful only if
it is comfortable. 

Jerzy Karczmarczuk 




More information about the Haskell-Cafe mailing list