Functional and Declarative Programming in Education (FDPE08)

This conference covers a lot of very interesting topics about the role of functional programming (FP) languages in education (follow the link for ample details). It sounds like a great conference!
(Its co-location with ICFP 2008 is yet another reason to attend, and as FP becomes more popular in the industry today, the question of how to teach FP to imperatively trained programmers becomes especially interesting.)

Composing Functions with Scheme

In the PLT thread [‘complement'[?] of map] Stephen de Gabriel asked if there was a function that would take any number of functions, and an argument, and then apply the first function to the argument, and apply the second function to the result of the first, and so on.
In PLT Scheme, the function is called ‘compose’. Compose:

Returns a procedure that composes the given functions, applying the last f first and the first f last. The composed functions can consume and produce any number of values, as long as each function produces as many values as the preceding function consumes.

I asked if this was typical FP style, and Noel replied that it is so common that compose is an infix operation in Haskell and ML, as far as he could recall.
Here is an example (from the thread) of how it works using the “Pretty Big” language:

(define pam
  (lambda (datum . proc-list)
    ((apply compose proc-list) datum)))
 (lambda (n) (/ n 7))
 (lambda (n) (- n 3))
 (lambda (n) (+ n 10))
 (lambda (n) (* n 7)))
> 3

Operating without change

How powerful is a programming language in which you do not utilize mutation?
Apparently very powerful. So much, in fact, that it was used to build the first prototype of the Fortress programming language.
Prediction for 2008, a new functional programming motto will emerge:

“Purely functional data structures: Strong enough to build a fortress!”

CUFP 07 Write-Up now available

A write-up on the Commercial Users of Functional Programming 07 conference is now available here.
It is definitely worth a read for folks who wonder about the “real world” problems that are solved using functional programming. There is a nice mix of both languages and problem domains, and the tone is pretty laid back.