weaving.core
->|
(->| & fns)
Returns a function that behaves like comp
but composes functions from left to right.
and|
(and|)
(and| f)
(and| f & more-fns)
Returns a function f
that runs fns
in order on the arguments of f
in the style of and
, i.e. breaking out of the chain upon false
or nil
.
apply|
(apply| f)
Transforms a function f
accepting one argument, presumably a sequence, into a function that applies this argument to f
.
doto|
(doto|)
(doto| & fns)
Returns a function that calls fns
in order, passing to each one its argument before returning it.
if|
(if| pred f)
(if| pred f else)
Returns a function that will run f
when pred
succeeds or otherwise run else
if it is provided (returns the passed value by default).
in|
(in| path f & more)
Transforms a one-argument function f
into a function receiving one collection and applying f
to the value at the location denoted by path
in this collection. Multiple path+function pairs can follow.
juxtm|
(juxtm| m)
(juxtm| k v & {:as more-kvs})
Like juxt except that functions are passed as values of a map whose shape is used to return their results, under the same key. The map can be an explicit map (one argument) or a flat, implicit map (variadic arguments).
or|
(or|)
(or| f)
(or| f & more-fns)
Returns a function that runs fns
in order in the style of or
, i.e. breaking out of the chain if one returns something different than false
or nil
.
unapply|
(unapply| f)
Transforms a function f
accepting any number of arguments into a function working on these arguments as a list.
when|
(when| pred & fns)
Returns a function that will run the fns
in order when pred
succeeds or return the value that was passed in otherwise.
|
(| f & args)
Returns a function like the result of partial
except that new args are added to the beginning of the parameter list rather than the end.
ø|
(ø| f)
Unpartialize the first argument of f
, i.e. returns a function that will apply all but the first argument to f
.
ø||
(ø|| f)
Unpartialize the last argument of f
, i.e. returns a function that will apply all but the last argument to f
.