> As another example, compare the propaganda version of quicksort in
> Haskell with a more realistic tail recursive one.
I remember thinking "wow!" when I first saw the Gentle Introduction
version of quicksort, then "hang on...that's not quicksort!". Whatever
happened to in-place update (one of the points of it, I thought), and can
I really be sure this will have the time behaviour I expect?
> Then you will only have to overcome the problem that most people are
> already hard pressed to understand functions as mappings from real
> numbers to real numbers, let alone as mappings from one function space
> to another.
This is a false problem, or rather, it's a question of presentation.
Most Haskell programmers know little category theory, but are quite happy
with monads. I find all sorts of problems that neophyte friends of mine
have (e.g. scientists who have to script a little for data collection and
analysis) that are down to arbitrary and stupid features of conventional
languages (C-like, BASIC-like) that would go away in a nice language (such
as Lua or Haskell; I'm not being FP-partisan here).
Personally, I find the source code for GHC much easier to read for being
written in Haskell, though of the three virtues I'm about to list, only
one is essentially FP: structurally based (pattern matching),
referentially transparent, syntactically clean. It bears a striking
resemblance to Martin Richards's BCPL compiler, written in BCPL (but my
initial reaction to the latter was "ugh, how verbose", because it's not a
style that BCPL supports elegantly; it's much better in MCPL).
--
http://sc3d.org/rrt/ | maxim, n. wisdom for fools