A Practical Combinator Library

1fbc9616
—
Zach Smith
3 months ago

Add license

89adac24
—
Zach Smith
3 months ago

Update version

0c7d76a2
—
Zach Smith
3 months ago

Add docs

- read-only
- https://git.sr.ht/~subsetpark/apcl-js
- read/write
- git@git.sr.ht:~subsetpark/apcl-js

See Combinatory Programming for details.

- identity
Returns its argument.

- left
Given two arguments, returns the left one.

- right
Given two arguments, returns the right one.

- constant()
Returns a function which returns

`x`

no matter what it is passed.- compose()
Performs function composition.

Any number of functions can be composed.

The innermost function may take any arguments; all subsequent functions expect a single argument.

- apply()
Returns a function which applies

`f`

to a spread of its argument.- flip()
Returns a function which permutes its arguments and applies them to

`f`

.- duplicate()
Returns a function that passes its argument to

`f`

twice.- recombine()
Returns a function that applies its arguments to

`g`

and`h`

, taking the resulting values as the arguments to`f`

.- under()
Returns a function that applies

`g`

to each of its arguments, taking the resulting values as the arguments to`f`

.

Returns its argument.

Given two arguments, returns the left one.

Given two arguments, returns the right one.

Returns a function which returns `x`

no matter what it is passed.

Performs function composition.

Any number of functions can be composed.

The innermost function may take any arguments; all subsequent functions expect a single argument.

Returns a function which applies `f`

to a spread of its argument.

Returns a function which permutes its arguments and applies them to `f`

.

Returns a function that passes its argument to `f`

twice.

Returns a function that applies its arguments to `g`

and `h`

, taking the
resulting values as the arguments to `f`

.

Returns a function that applies `g`

to each of its arguments, taking the
resulting values as the arguments to `f`

.

**Kind**: global function