HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Combinator pattern

Categories: Idioms | Combinators


Libraries such as Parsec use the combinator pattern, where complex structures are built by defining a small set of very simple 'primitives', and a set of 'combinators' for combining them into more complicated structures. It's somewhat similar to the Composition pattern found in object-oriented programming.

In the case of the Parsec, the library provides a set of extremely simple (almost trivial) parsers, and ways to combine small parsers into bigger parsers. Many other libraries and programs use the same ideas to build other structures:

Retrieved from "http://haskell.org/haskellwiki/Combinator_pattern"

This page has been accessed 1,635 times. This page was last modified 22:52, 17 May 2007. Recent content is available under a simple permissive license.