Personal tools

Combinator

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m (Formatting mistake)
(clarify two different meanings of "combinator")
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A function or definition with no [[Free variable]]s.
+
There are two distinct uses of the word "combinator" in common usage.
   
'''Question:''' On which syllable do you put the accent when saying "combinator"?
+
The first is a narrow, technical meaning, namely:
  +
  +
''A function or definition with no [[free variable]]s.''
  +
  +
A "function with no free variables" is a pure lambda-expression that refers only to its arguments, like
  +
  +
<code>
  +
\a -> a
  +
\a -> \b -> a
  +
\f -> \a -> \b -> f b a
  +
</code>
  +
  +
and so on. The study of such things is called [[combinatory logic]]. They are certainly used in Haskell -- the examples above are <code>id</code>, <code>const</code>, and <code>flip</code> respectively. Many of the functions involved in the <code>Applicative</code> instance for <code>((->) e)</code> also fall into this category. But such examples are fairly limited.
  +
  +
The second meaning of "combinator" is a more informal sense referring to the [[combinator pattern]], a style of organizing libraries centered around the idea of combining things. This is the meaning of "combinator" which is more frequently encountered in the Haskell community. Usually there is some type T, some functions for constructing "primitive" values of type T, and some "combinators" which can combine values of type T in various ways to build up more complex values of type T.
  +
  +
  +
'''Question:''' On which syllable do you put the stress when saying "combinator"?
   
 
''I say COM-bin-ay-tur, since it comes from "combine". -- [[User:AndrewBromage]]''
 
''I say COM-bin-ay-tur, since it comes from "combine". -- [[User:AndrewBromage]]''
   
 
See also:
 
See also:
  +
* [[Combinatory logic]]
 
* [[Combinator pattern]], which has a good start on how combinators are used in programming
 
* [[Combinator pattern]], which has a good start on how combinators are used in programming
 
* [[Super combinator]]
 
* [[Super combinator]]
   
 
[[Category:Glossary]]
 
[[Category:Glossary]]
  +
  +
[[Category:Combinators]]

Latest revision as of 14:13, 20 September 2012

There are two distinct uses of the word "combinator" in common usage.

The first is a narrow, technical meaning, namely:

A function or definition with no free variables.

A "function with no free variables" is a pure lambda-expression that refers only to its arguments, like

 \a -> a
 \a -> \b -> a
 \f -> \a -> \b -> f b a

and so on. The study of such things is called combinatory logic. They are certainly used in Haskell -- the examples above are id, const, and flip respectively. Many of the functions involved in the Applicative instance for ((->) e) also fall into this category. But such examples are fairly limited.

The second meaning of "combinator" is a more informal sense referring to the combinator pattern, a style of organizing libraries centered around the idea of combining things. This is the meaning of "combinator" which is more frequently encountered in the Haskell community. Usually there is some type T, some functions for constructing "primitive" values of type T, and some "combinators" which can combine values of type T in various ways to build up more complex values of type T.


Question: On which syllable do you put the stress when saying "combinator"?

I say COM-bin-ay-tur, since it comes from "combine". -- User:AndrewBromage

See also: