Function composition is a common operation in functional programming.
Given some number of input functions, these functions return new functions
which represents the composition of the inputs. That is, for three functions
f, g, h,
compose(f, g, h) returns a function equivalent for all x to
composeM handles the case of functions of multiple
1 2 3
Objects to compose. See 'Details'.
An environment in which to resolve any character or symbol arguments.
compose, the functions passed must all take a single argument.
composeM, the functions passed must take n >= 1 arguments, and
return a list or vector.
composeM's returned function proceeds right
to left through the functions it composes, applying each to the sequence of
arguments returned by the previous function (via
first function is called with the actual arguments passed.
If some of the
... arguments are not function objects, they are
resolved to function objects in the following way: character arguments
are looked up in the provided
where environment; symbol arguments
are coerced to character and then looked up in the
other types of arguments, or symbol/character arguments which fail to
resolve to a function object, raise an error.
A function representing the composition of the arguments.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.