Functional design patterns (was: How to get functional software engineering experience?)

Joe English jenglish@flightlab.com
Wed, 15 May 2002 12:43:54 -0700


Ralf Laemmel wrote:
>
> Joost Visser and I, we worked out a few maybe not so obvious functional
> programming pattern [...]
>      http://www.cs.vu.nl/Strafunski/dp-sf/

Neat!


> I have the feeling that the FP community has a hard time getting started
> with design patterns.

I believe quite the opposite: there are plenty of FP design patterns
in common use, it's just that FP'ers don't usually use the term
"design patterns" to describe them.  I'm thinking of things
like catamorphisms, anamorphisms (aka folds/unfolds), monads
and functors, "the zipper", and of course the various catalogues
of polytypic routines.

> Part of the problem is that design patterns are
> inherently "vague" and this is maybe something the authors in our field
> do not like to consider.

That's the main difference between FP patterns and OO patterns.
OO patterns tend to be informal, intuitive guidelines; and
though some FP patterns are like this (e.g., "combinator library",
"embedded domain-specific language"), the majority can be
described rigorously.  This gives them an added usefulness --
you can actually "calculate" with them.


--Joe English

  jenglish@flightlab.com