[Haskell-cafe] capture of idioms and patterns
stephen.tetley at gmail.com
Wed Sep 22 06:42:41 EDT 2010
There is a catalogue of patterns for "strategic traversal" - Ralf
Lammel (umlauts on the a in Lammel) and Joost Visser - "Design
Patterns for Functional Strategic Programming". Strategic traversal is
a "sub-field" of generic programming.
This was very valuable work, at the time Strafunski had various
research papers but no manual as such. Without the pattern catalogue,
one had to work through the manual for Stratego - the programming
language that inspired Strafunski - and transliterate to Haskell. This
was very difficult - Stratego is untyped, Strafuski used cutting edge
features of Haskell's type system.
It is a pity that there aren't more pattern catalogues for functional
programming idioms. The functionals (maps, folds unfolds) and the
monads could definitely be documented as design patterns, but there is
lot of further ground that merits coverage - e.g. it would be nice if
something captured good uses of existential types as design patterns.
A book on program *design* focused on Haskell or other functional
languages is very much missing, hopefully Richard Bird's new book will
go some way towards this (although I think the book aims at something
rather different - developing elegant algorithms - "pearls", rather
than program design per se).
More information about the Haskell-Cafe