Update readme
git ignore
correct apply
See Combinatory Programming for details.
This library is an implementation of the higher-order functions described in the article above, for the Janet programming language.
import
or use
this library, and invoke the functions it provides in order
to program in a tacit style.
Janet 1.32.1-a93517f linux/x64/gcc - '(doc)' for help
repl:1:> (use ./apcl)
@{_ @{:value <cycle 0>} apply @{:private true} constant @{:private true} duplicate @{:private true} flip @{:private true} left @{:private true} recombine @{:private true} right @{:private true} under @{:private true}}
repl:2:> (def square (duplicate *))
<function call-duplicate>
repl:3:> (square 6)
36
apply, constant, duplicate, flip, left, recombine, right, under
function | source
(apply f)
Returns a function that applies f
to a splice of its arguments.
function | source
(constant x)
Returns a function that always returns x
.
function | source
(duplicate f)
Returns a function which, given one argument, calls f
with that argument provided twice.
function | source
(flip f)
Returns a function which, given two arguments, calls f
with those two arguments permuted.
function | source
<function call-left>
A function which, given two arguments, returns the left one.
function | source
(recombine f g h)
Returns a function that applies its arguments to g
and h
, taking the resulting values as the arguments to f
.
function | source
<function call-right>
A function which, given two arguments, returns the right one.
function | source
(under f g)
Returns a function that applies g
to each of its arguments, taking the resulting values as the arguments to f
.