Portability | to be determined |
---|---|
Stability | experimental |
Maintainer | stephen.tetley@gmail.com |
Safe Haskell | Safe-Inferred |
Bird monickered combinators
This module is intended for illustration (the type signatures!) rather than utility.
The 'long reach' Turner set { S, K, I, B, C, S', B', C' }
The Joy et al. set { S, I, B, C, J(alt), S', B', C', J(alt)' }
- idiot :: a -> a
- kestrel :: a -> b -> a
- bluebird :: (b -> c) -> (a -> b) -> a -> c
- cardinal :: (a -> b -> c) -> b -> a -> c
- applicator :: (a -> b) -> a -> b
- psi :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- becard :: (c -> d) -> (b -> c) -> (a -> b) -> a -> d
- blackbird :: (c -> d) -> (a -> b -> c) -> a -> b -> d
- bluebird' :: (a -> c -> d) -> a -> (b -> c) -> b -> d
- bunting :: (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> e
- cardinal' :: (c -> a -> d) -> (b -> c) -> a -> b -> d
- cardinalstar :: (a -> c -> b -> d) -> a -> b -> c -> d
- cardinalstarstar :: (a -> b -> d -> c -> e) -> a -> b -> c -> d -> e
- dove :: (a -> c -> d) -> a -> (b -> c) -> b -> d
- dickcissel :: (a -> b -> d -> e) -> a -> b -> (c -> d) -> c -> e
- dovekie :: (c -> d -> e) -> (a -> c) -> a -> (b -> d) -> b -> e
- eagle :: (a -> d -> e) -> a -> (b -> c -> d) -> b -> c -> e
- eaglebald :: (e -> f -> g) -> (a -> b -> e) -> a -> b -> (c -> d -> f) -> c -> d -> g
- finch :: a -> b -> (b -> a -> c) -> c
- finchstar :: (c -> b -> a -> d) -> a -> b -> c -> d
- finchstarstar :: (a -> d -> c -> b -> e) -> a -> b -> c -> d -> e
- goldfinch :: (b -> c -> d) -> (a -> c) -> a -> b -> d
- hummingbird :: (a -> b -> a -> c) -> a -> b -> c
- idstar :: (a -> b) -> a -> b
- idstarstar :: (a -> b -> c) -> a -> b -> c
- jalt :: (a -> c) -> a -> b -> c
- jalt' :: (a -> b -> d) -> a -> b -> c -> d
- jay :: (a -> b -> b) -> a -> b -> a -> b
- kite :: a -> b -> b
- owl :: ((a -> b) -> a) -> (a -> b) -> b
- phoenix :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
- quacky :: a -> (a -> b) -> (b -> c) -> c
- queer :: (a -> b) -> (b -> c) -> a -> c
- quirky :: (a -> b) -> a -> (b -> c) -> c
- quixotic :: (b -> c) -> a -> (a -> b) -> c
- quizzical :: a -> (b -> c) -> (a -> b) -> c
- robin :: a -> (b -> a -> c) -> b -> c
- robinstar :: (b -> c -> a -> d) -> a -> b -> c -> d
- robinstarstar :: (a -> c -> d -> b -> e) -> a -> b -> c -> d -> e
- starling :: (a -> b -> c) -> (a -> b) -> a -> c
- starling' :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
- thrush :: a -> (a -> b) -> b
- vireo :: a -> b -> (a -> b -> c) -> c
- vireostar :: (b -> a -> b -> d) -> a -> b -> b -> d
- vireostarstar :: (a -> c -> b -> c -> e) -> a -> b -> c -> c -> e
- warbler :: (a -> a -> b) -> a -> b
- warbler1 :: a -> (a -> a -> b) -> b
- warblerstar :: (a -> b -> b -> c) -> a -> b -> c
- warblerstarstar :: (a -> b -> c -> c -> d) -> a -> b -> c -> d
Data.Function combinators as birds
K combinator - kestrel - Haskell const
.
Corresponds to the encoding of true
in the lambda calculus.
applicator :: (a -> b) -> a -> bSource
A combinator - apply / applicator - Haskell ($
).
This is also called i-star
.
Other birds (alphabetical)
bunting :: (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> eSource
B2 combinator - bunting - specs ooo
.
cardinalstar :: (a -> c -> b -> d) -> a -> b -> c -> dSource
C* combinator - cardinal once removed.
cardinalstarstar :: (a -> b -> d -> c -> e) -> a -> b -> c -> d -> eSource
C** combinator - cardinal twice removed.
dickcissel :: (a -> b -> d -> e) -> a -> b -> (c -> d) -> c -> eSource
D1 combinator - dickcissel.
eaglebald :: (e -> f -> g) -> (a -> b -> e) -> a -> b -> (c -> d -> f) -> c -> d -> gSource
E ^ - bald eagle. For alphabetical regularity it is somewhat misnamed here as eaglebald.
finchstarstar :: (a -> d -> c -> b -> e) -> a -> b -> c -> d -> eSource
F** combinator - finch twice removed.
hummingbird :: (a -> b -> a -> c) -> a -> b -> cSource
H combinator - hummingbird.
idstar :: (a -> b) -> a -> bSource
I* combinator - identity bird once removed
Alias of applicator
, Haskell's ($
).
idstarstar :: (a -> b -> c) -> a -> b -> cSource
I** combinator - identity bird twice removed
jalt :: (a -> c) -> a -> b -> cSource
Alternative J combinator - this is the J combintor of Joy, Rayward-Smith and Burton (see. Antoni Diller 'Compiling Functional Languages' page 104). It is not the J - jay combinator of the literature.
jalt' :: (a -> b -> d) -> a -> b -> c -> dSource
J' combinator - from Joy, Rayward-Smith and Burton.
See the comment to jalt
.
phoenix :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> dSource
(Big) Phi combinator - phoenix - Haskell liftM2
.
This is the same function as starling'
.
queer :: (a -> b) -> (b -> c) -> a -> cSource
Q combinator - queer bird.
Haskell (##)
in Peter Thiemann's Wash, reverse composition.
robinstarstar :: (a -> c -> d -> b -> e) -> a -> b -> c -> d -> eSource
R** combinator - robin twice removed.
starling :: (a -> b -> c) -> (a -> b) -> a -> cSource
S combinator - starling.
Haskell: Applicative's (<*>)
on functions.
Substitution.
starling' :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> dSource
S' combinator - starling prime - Turner's big phi.
Haskell: Applicative's liftA2
on functions (and similarly
Monad's liftM2
).
This is the same function as phoenix
.
thrush :: a -> (a -> b) -> bSource
T combinator - thrush.
Haskell (#)
in Peter Thiemann's Wash, reverse application.
vireostarstar :: (a -> c -> b -> c -> e) -> a -> b -> c -> c -> eSource
V** combinator - vireo twice removed.
warbler1 :: a -> (a -> a -> b) -> bSource
W1 combinator - converse warbler.
warbler
with the arguments reversed.
warblerstar :: (a -> b -> b -> c) -> a -> b -> cSource
W* combinator - warbler once removed.
warblerstarstar :: (a -> b -> c -> c -> d) -> a -> b -> c -> dSource
W** combinator - warbler twice removed.