doc.txt

Combinators: Useful, higher-order functions.

_Combinators: Useful, higher-order functions._

Written by: Carl Eastlund (cce at ccs dot neu dot edu)
Keywords: _combinator_, _combinators_, _higher-order_

================================================================================

> ((curry f arg ...) more ...) = (f arg ... more ...)

This combinator partially applies its first argument.  Its remaining arguments
become the initial arguments to f; it produces a function which takes the final
arguments.

> ((yrruc f arg ...) more ...) = (f more ... arg ...)

This combinator partially applies its first argument.  Its remaining arguments
become the final arguments to f; it produces a function which takes the initial
arguments.

> (constant v) = (lambda (arg ...) v)

This combinator produces a function with a constant return value.

> (compose/apply f1 ... fn) = (lambda args (apply f1 ... (apply fn args)))

This combinator composes several functions such that the last argument is
applied first.  The output of each function is passed as the list of arguments
to the next.

> (map2 f (list v_1 ...1 v_n) ...2) = (list a_1 ...1 a_n) (list b_1 ...1 b_n)
  where (f v_k ...2) = (values a_k b_k)

This combinator maps a function of two return values over one or more lists. It
produces two lists representing all the first and second values, respectively,
of the applications of the function.