map/pmap (a.k.a. Fan-Out)
(map some-function some-data)
Apply some-function to each entry of the array of
data in some-data. Then return the result as a new
array. In parallel: use pmap.
Why? To process lots of data.
apply (a.k.a. Proxy)
(apply some-function x y z)
Call some-function with arguments x, y, and z.
Why? To make the function to be called a variable
comp (a.k.a. Function Chaining)
(comp some-function some-other-function)
Create a function that first calls some-function on
the arguments, and then some-other-function
on the results.
Why? To call multiple services in order.
reduce (a.k.a. Fan-In)
(reduce some-function some-data)
Call some-function on the first item of some-
data, then call some-function again, using the
result of the prior invocation and the next item in
some-data as arguments.
Why? To compress large data sets into small results.
fold (a.k.a. Fan-In with ! on Top)
(fold reducef combined some-data)
Break some-data into multiple sets, run (reduce
reducef) on each, then run (combine
combinef) on the results.
Why? To compress really large data sets into small
results, in multiple steps.
iterate (a.k.a. Endless Function)
(iterate start-value some-function)
Create a function that creates a data stream starting
with start-value from repeated calls to some-
Why? To turn some-function into a data emitter,
without some-function needing state.
juxt (a.k.a. Parallel Functions)
(juxt some-function some-other-function)
Makes a function that calls some-function and
some-other-function and returns a combined
Why? To combine the results of multiple functions in
memoize (a.k.a. Good Ol’ Cache)
Return a cached version of some-function that
returns the same value for the same arguments.
Why? To trade slow computing against fast cache
partial (a.k.a. Wrapper)
(partial some-function value)
Creates a function that calls some-function with
value as an argument, in addition to other
Why? To provide default values and make powerful
functions less dangerous.