UserPreferences

CommonHaskellIdioms


There are a number of idioms, or design patterns, or styles of programming, that are frequently used by experienced programmers. In the same way for (i=0; i<10; i++) rolls off a C programmer's tongue, these idioms roll off the tongues (or keyboards) of the Haskell programmers. If you want them to roll off your tongue too, read these pages.

You may also want to see the FrequentlyAskedQuestions, or the more theoretical LessFrequentlyAskedQuestions.

Basic techniques

Code Examples

Constructing objects

Designing data structures

Control flow

Efficiency

Combinators

Types

Advanced techniques

Catalogues and catalogue styles

The paper DesignPatternsForFunctionalStrategicProgramming initiates a catalogue of design patterns for generic functional programming with StraFunski.

[WWW]A Functional Pattern System for Object-Oriented Design: This makes a reasonable catalogue of some of the more (or less) basic patterns/techniques that functional programmers use. For an experienced functional programmer most of this should be familiar if not second nature, but for someone just starting coming from an imperative/OO background, it makes a wonderful introduction and explanation of the what and whys of functional techniques (for example our love of folds).

Compared with OO

http://c2.com/cgi/wiki?OoVsFunctional OO Compared with functional on the Portland Pattern Reposistory wiki

Parts of that page have been updated and expanded into an article for TheMonadReader by ?AlistairBayley - http://www.haskell.org/tmrwiki/FpVsOo

See also: ReFactoring


Return to FrontPage.


CategoryIdiom