[Haskell-cafe] Re: capture of idioms and patterns

ajb at spamcop.net ajb at spamcop.net
Thu Sep 23 02:24:33 EDT 2010

G'day all.

Quoting Johannes Waldmann <waldmann at imn.htwk-leipzig.de>:

> you got this backwards: what some folks call "idioms and (design) patterns"
> actually *is* FP, because it is just this: higher order functions.
> And it's been there some decades (lambda calculus).
> That also explains the absence of any Design Patterns/Gang-of-Four
> kind of book for Haskell - it's just not needed.

Err... no.

The phrase "design patterns" is a shorthand for "vocabulary of
engineering experience".  Zippers, continuation passing style, Church
encoding... these are not what FP "is", but they are specific techniques
that engineers working in Haskell need to know to use the language

You can think of design patterns as techniques that you need to overcome
shortcomings in the language.  That's why you need special techniques
for, say, iterators in C++ or Java where in Haskell that comes more or
less for free.  But then, you need special techniques for mutable global
state in Haskell, where in C++ or Java you get that for free.  Or, to put
it another way, nothing is ever free.

There is no GoF-like book for Haskell because it's not an idea that
needs promoting in printed form.  We just point people to the wiki.

Andrew Bromage

More information about the Haskell-Cafe mailing list