[Haskell-cafe] Haskell for non-mathematicians (was: Specify array or list size?)

Graham Klyne GK at ninebynine.org
Mon May 9 06:45:06 EDT 2005

At 13:08 07/05/05 -0400, David Roundy wrote:
>On Sat, May 07, 2005 at 12:40:55PM -0400, Daniel Carrera wrote:
> > In your opinion, do you think Haskell is appropriate for someone with
> > zero math background? I can't imagine how I'd explain something like
> > currying to someone who doesn't know math.
>I'd think it'd be pretty easy for a non-mathy non-programmer person to
>learn (based on pure speculation--I've never taught haskell).  There is a
>sort of "basic core" of haskell that is pretty easy, and most of the higher
>level concepts are a sort of nicer way to say the same thing.  For example,
>while lambda expressions are very nice, it's always possible to do the same
>thing by declaring a named function in a let or where clause.

I'm reminded of something mentioned by Alan Kay in a recent interview 
published in ACM Queue magazine:
  AK [...]

One of the things that people realized from these extensible languages is 
that there is the unfortunate difficulty of making the meta-system easy to 
use. Smalltalk-72 was actually used by children. You’re always extending 
the language without realizing it when you are making ordinary classes. The 
result of this was that you didn’t have to go into a more esoteric place 
like a compiler compiler—Yacc or something like that—to add some extension 
to the language.

But the flip side of the coin was that even good programmers and language 
designers tended to do terrible extensions when they were in the heat of 
programming, because design is something that is best done slowly and 

SF And late-night extensible programming is unsupportable.

AK Exactly. So Smalltalk actually went from something that was completely 
extensible to one where we picked a syntax that allowed for a variety of 
forms of what was fixed, and concentrated on the extensibility of meaning 
in it.

This is not completely satisfactory. One of the things that I think should 
be done today is to have a fence that you have to hop to forcibly remind 
you that you’re now in a meta-area—that you are now tinkering with the 
currency system itself, you are not just speculating. But it should allow 
you to do it without any other overhead once you’ve crossed this fence, 
because when you want to do it, you want to do it.
-- http://www.acmqueue.com/modules.php?name=Content&pa=showpage&pid=273

When I read the above, I found myself thinking of two styles of Haskell 
programming:  on one hand there are some, many on these mailing lists, but 
I pick Oleg as an exemplar, who continue to baffle me with the amazing 
tricks they can do with (say) the Haskell type system.  And there are 
"ordinary programmers" (like myself) who want to use Haskell's small core 
and (not-so-small) type system to find more elegant ways to write 
application software (e.g. http://www.cs.kent.ac.uk/projects/vital/ - if IO 
were added).  I find that higher order functions and currying provide 
powerful tools to isolate different aspects of a program's functionality, 
but I'm not sure I'd want to explain them to a complete novice programmer.

So, responding to the original comment, I think there's a core of Haskell 
that's probably quite suitable for non-mathematical programmers, but 
there's a lot of potential to build application frameworks that requires a 
mathematical kind of abstract and analytical approach, if not specifically 
a mathematical background.  A challenge that I think a little about, 
sometimes, is how to keep them distinct, which is a point to which Alan Kay 
seems to be alluding (above).


Graham Klyne
For email:

More information about the Haskell-Cafe mailing list