~subsetpark/apcl-js

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

refs

master
browse  log 

clone

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

You can also use your local clone with git send-email.

#A Practical Combinator Library

See Combinatory Programming for details.

#API

#Constants

identity

Returns its argument.

left

Given two arguments, returns the left one.

right

Given two arguments, returns the right one.

#Functions

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.

#identity

Returns its argument.

Kind: global constant

#left

Given two arguments, returns the left one.

Kind: global constant

Given two arguments, returns the right one.

Kind: global constant

#constant()

Returns a function which returns x no matter what it is passed.

Kind: global function

#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.

Kind: global function

#apply()

Returns a function which applies f to a spread of its argument.

Kind: global function

#flip()

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

Kind: global function

#duplicate()

Returns a function that passes its argument to f twice.

Kind: global function

#recombine()

Returns a function that applies its arguments to g and h, taking the resulting values as the arguments to f.

Kind: global function

#under()

Returns a function that applies g to each of its arguments, taking the resulting values as the arguments to f.

Kind: global function