Difference between revisions of "Combinator"

From HaskellWiki
Jump to navigation Jump to search
(on a second thought, I don't pronounce it that way, so let the supposedly non-existent centrifugal force push this diff off the hard disk platter)
m (fmt fix)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  +
There are two distinct meanings of the word "combinator" in common usage.
A function or definition with no [[Free variable]]s.
 
   
  +
The first is a narrow, technical meaning, namely:
'''Question:''' On which syllable do you put the accent when saying "combinator"?
 
  +
 
''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
  +
  +
<haskell>
  +
\a -> a
  +
\a -> \b -> a
  +
\f -> \a -> \b -> f b a
  +
</haskell>
  +
  +
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]]

Latest revision as of 11:09, 12 April 2021

There are two distinct meanings 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: