Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Feb 5, 2020
1 parent 75aa2d1 commit 99f7a2f
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,35 @@ composer require loophp/combinator

## Available combinators

| Combinator | Alias | Haskel | Lambda calculus | Term definition (JS like) | Type | # Arguments |
|------------|------------- |---------|-----------------------------|------------------------------------------|------------------------------------------------------|-------------|
| A | Apply | `$` | `λab.ab` | `a => b => a(b)` | `(a -> b) -> a -> b` | 2 |
| B | Bluebird | `.` | `λabc.a(bc)` | `a => b => c => a(b(c))` | `(a -> b) -> (c -> a) -> c -> b` | 3 |
| C | Cardinal | `flip` | `λabc.acb` | `a => b => c => a(c)(b)` | `(a -> b -> c) -> b -> a -> c` | 3 |
| D | Dove | | `λabcd.ab(cd)` | `a => b => c => d => a(b)(c(d))` | `(a -> c -> d) -> a -> (b -> c) -> b -> d` | 4 |
| E | Eagle | | `λabcde.ab(cde)` | `a => b => c => d => e => a(b)(c(d)(e))` | `(a -> d -> e) -> a -> (b -> c -> d) -> b -> c -> e` | 5 |
| F | Finch | | `λabc.cba` | `a => b => c => c(b)(a)` | `a -> b -> (b -> a -> c) -> c` | 3 |
| G | Goldfinch | | `λabcd.ad(bc)` | `a => b => c => d => a(d)(b(c))` | `(a -> b -> c) -> (d -> b) -> d -> a -> c` | 4 |
| H | Hummingbird | | `λabc.abcb` | `a => b => c => a(b)(c)(b)` | `(a -> b -> a -> c) -> a -> b -> c ` | 3 |
| I | Idiot | `id` | `λa.a` | `a => a` | `a -> a` | 1 |
| J | Jay | | `λabcd.ab(adc)` | `a => b => c => d => a(b)(a(d)(c))` | `(a -> b -> b) -> a -> b -> a -> b` | 4 |
| K | Kestrel | `const` | `λab.a` | `a => b => a` | `a -> b -> a` | 2 |
| Ki | Kite | | `λab.b` | `a => b => b` | `a -> b -> b` | 2 |
| L | Lark | | `λab.a(bb)` | `a => b => a(b(b))` | | 2 |
| M | Mockingbird | | `λa.aa` | `a => a(a)` | | 1 |
| O | Owl | | `λab.b(ab)` | `a => b => b(a(b))` | `((a -> b) -> a) -> (a -> b) -> b` | 2 |
| Omega | Ω | `MM` | `λa.(aa)(aa)` | `a => (a(a))(a(a))` | | 1 |
| Phoenix | | | `λabcd.a(bd)(cd)` | `a => b => c => d => a(b(d))(c(d))` | `(a -> b -> c) -> (d -> a) -> (d -> b) -> d -> c` | 4 |
| Psi | | `on` | `λabcd.a(bc)(bd)` | `a => b => c => d => a(b(c))(b(d))` | `(a -> a -> b) -> (c -> a) -> c -> c -> b` | 4 |
| Q | Queer | `(##)` | `λabc.b(ac)` | `a => b => c => b(a(c))` | `(a -> b) -> (b -> c) -> a -> c` | 3 |
| R | Robin | | `λabc.bca` | `a => b => c => b(c)(a)` | `a -> (b -> a -> c) -> b -> c` | 3 |
| S | Starling | `<*>` | `λabc.ac(bc)` | `a => b => c => a(c)(b(c))` | `(a -> b -> c) -> (a -> b) -> a -> c` | 3 |
| T | Trush | `(#)` | `λab.ba` | `a => b => b(a)` | `a -> (a -> b) -> b` | 2 |
| U | Turing bird | | `λab.b(aab)` | `a => b => b(a(a)(b))` | | 2 |
| V | Vireo | | `λabc.cab` | `a => b => c => c(a)(b)` | `a -> b -> (a -> b -> c) -> c` | 3 |
| W | Warbler | | `λab.abb` | `a => b => a(b)(b)` | `(a -> a -> b) -> a -> b` | 2 |
| Y | Y-Fixed point | | `λa.(λb(a(bb))(λb(a(bb))))` | `a => (b => b(b))(b => a(c => b(b)(c)))` | | 1 |
| Z | Z-Fixed point | | `λa.M(λb(a(Mb)))` | | | 1 |
| Name | Alias | Composition | Composition using S and K | Haskel | Lambda calculus | Term definition (JS like) | Type | # Arguments |
|---------|---------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------------------------|------------------------------------------|------------------------------------------------------|-------------|
| A | Apply | `SK(SK)` | `(S(K))(S(K))` | `$` | `λab.ab` | `a => b => a(b)` | `(a -> b) -> a -> b` | 2 |
| B | Bluebird | `S(KS)K` | `S(KS)K` | `.` | `λabc.a(bc)` | `a => b => c => a(b(c))` | `(a -> b) -> (c -> a) -> c -> b` | 3 |
| C | Cardinal | `S(BBS)(KK)` | `((S((S(K((S(KS))K)))S))(KK))` | `flip` | `λabc.acb` | `a => b => c => a(c)(b)` | `(a -> b -> c) -> b -> a -> c` | 3 |
| D | Dove | `BB` | `(S(K((S(KS))K)))` | | `λabcd.ab(cd)` | `a => b => c => d => a(b)(c(d))` | `(a -> c -> d) -> a -> (b -> c) -> b -> d` | 4 |
| E | Eagle | `B(BBB)` | `(S(K((S(K((S(KS))K)))((S(KS))K))))` | | `λabcde.ab(cde)` | `a => b => c => d => e => a(b)(c(d)(e))` | `(a -> d -> e) -> a -> (b -> c -> d) -> b -> c -> e` | 5 |
| F | Finch | `ETTET` | `((S(K((S((SK)K))(K((S(K(S((SK)K))))K)))))((S(K((S(K((S(KS))K)))((S(KS))K))))((S(K(S((SK)K))))K)))` | | `λabc.cba` | `a => b => c => c(b)(a)` | `a -> b -> (b -> a -> c) -> c` | 3 |
| G | Goldfinch | `BBC` | `((S(K((S(KS))K)))((S((S(K((S(KS))K)))S))(KK)))` | | `λabcd.ad(bc)` | `a => b => c => d => a(d)(b(c))` | `(a -> b -> c) -> (d -> b) -> d -> a -> c` | 4 |
| H | Hummingbird | `BW(BC)` | `((S(K((S(K(S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))))K)))(S(K((S((S(K((S(KS))K)))S))(KK)))))` | | `λabc.abcb` | `a => b => c => a(b)(c)(b)` | `(a -> b -> a -> c) -> a -> b -> c ` | 3 |
| I | Idiot | `SKK` | `((SK)K)` | `id` | `λa.a` | `a => a` | `a -> a` | 1 |
| J | Jay | `B(BC)(W(BC(E)))` | `((S(K(S(K((S((S(K((S(KS))K)))S))(KK))))))((S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))(K((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S(K((S(KS))K)))((S(KS))K))))))))` | | `λabcd.ab(adc)` | `a => b => c => d => a(b)(a(d)(c))` | `(a -> b -> b) -> a -> b -> a -> b` | 4 |
| K | Kestrel | `K` | `K` | `const` | `λab.a` | `a => b => a` | `a -> b -> a` | 2 |
| Ki | Kite | `KI` | `(K((SK)K))` | | `λab.b` | `a => b => b` | `a -> b -> b` | 2 |
| L | Lark | `CBM` | `((S((S(KS))K))(K((S((SK)K))((SK)K))))` | | `λab.a(bb)` | `a => b => a(b(b))` | | 2 |
| M | Mockingbird | `SII` | `((S((SK)K))((SK)K))` | | `λa.aa` | `a => a(a)` | | 1 |
| O | Owl | `SI` | `(S((SK)K))` | | `λab.b(ab)` | `a => b => b(a(b))` | `((a -> b) -> a) -> (a -> b) -> b` | 2 |
| Omega | Ω | `MM` | `(((S((SK)K))((SK)K))((S((SK)K))((SK)K)))` | | `λa.(aa)(aa)` | `a => (a(a))(a(a))` | | 1 |
| Phoenix | | | | | `λabcd.a(bd)(cd)` | `a => b => c => d => a(b(d))(c(d))` | `(a -> b -> c) -> (d -> a) -> (d -> b) -> d -> c` | 4 |
| Psi | | | | `on` | `λabcd.a(bc)(bd)` | `a => b => c => d => a(b(c))(b(d))` | `(a -> a -> b) -> (c -> a) -> c -> c -> b` | 4 |
| Q | Queer | `CB` | `((S(K(S((S(KS))K))))K)` | `(##)` | `λabc.b(ac)` | `a => b => c => b(a(c))` | `(a -> b) -> (b -> c) -> a -> c` | 3 |
| R | Robin | `BBT` | `((S(K((S(KS))K)))((S(K(S((SK)K))))K))` | | `λabc.bca` | `a => b => c => b(c)(a)` | `a -> (b -> a -> c) -> b -> c` | 3 |
| S | Starling | `S` | `S` | `<*>` | `λabc.ac(bc)` | `a => b => c => a(c)(b(c))` | `(a -> b -> c) -> (a -> b) -> a -> c` | 3 |
| T | Trush | `CI` | `((S(K(S((SK)K))))K)` | `(#)` | `λab.ba` | `a => b => b(a)` | `a -> (a -> b) -> b` | 2 |
| U | Turing | `LO` | `((S(K(S((SK)K))))((S((SK)K))((SK)K)))` | | `λab.b(aab)` | `a => b => b(a(a)(b))` | | 2 |
| V | Vireo | `BCT` | `((S(K((S((S(K((S(KS))K)))S))(KK))))((S(K(S((SK)K))))K))` | | `λabc.cab` | `a => b => c => c(a)(b)` | `a -> b -> (a -> b -> c) -> c` | 3 |
| W | Warbler | `C(BMR)` | `((S(K(S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))))K)` | | `λab.abb` | `a => b => a(b)(b)` | `(a -> a -> b) -> a -> b` | 2 |
| Y | Y-Fixed point | | | | `λa.(λb(a(bb))(λb(a(bb))))` | `a => (b => b(b))(b => a(c => b(b)(c)))` | | 1 |
| Z | Z-Fixed point | | | | `λa.M(λb(a(Mb)))` | | | 1 |

## Usage

Expand Down

0 comments on commit 99f7a2f

Please sign in to comment.