Liking cljdoc? Tell your friends :D

active.clojure.functions

Redefines higher order functions and function combinators from clojure.core via applicable records (ifn? but not fn?). The advantage is, that those objects compare = if they are created from equal arguments. Disadvantages are that they are probably a bit slower. They also don't implement some additional protocols like Runnable yet.

Redefines higher order functions and function combinators from
clojure.core via applicable records (ifn? but not fn?). The
advantage is, that those objects compare = if they are created from
equal arguments. Disadvantages are that they are probably a bit
slower. They also don't implement some additional protocols like
Runnable yet.
raw docstring

bound-fn*clj

(bound-fn* f)

Returns a function, which will install the same bindings in effect as in the thread at the time bound-fn* was called and then call f with any given arguments. This may be used to define a helper function which runs on a different thread, but needs the same bindings in place.

Returns a function, which will install the same bindings in effect as in
the thread at the time bound-fn* was called and then call f with any given
arguments. This may be used to define a helper function which runs on a
different thread, but needs the same bindings in place.
sourceraw docstring

compclj/s

(comp)
(comp f)
(comp f g & fs)

Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc.

Takes a set of functions and returns a fn that is the composition
of those fns.  The returned fn takes a variable number of args,
applies the rightmost of fns to the args, the next
fn (right-to-left) to the result, etc.
sourceraw docstring

complementclj/s

(complement f)

Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value.

Takes a fn f and returns a fn that takes the same arguments as f,
has the same effects, if any, and returns the opposite truth value.
sourceraw docstring

completingclj/s

(completing f)
(completing f cf)

Takes a reducing function f of 2 args and returns a fn suitable for transduce by adding an arity-1 signature that calls cf (default - identity) on the result argument.

Takes a reducing function f of 2 args and returns a fn suitable for
transduce by adding an arity-1 signature that calls cf (default -
identity) on the result argument.
sourceraw docstring

constantlyclj/s

(constantly v)

Returns a function that takes any number of arguments and returns x.

Returns a function that takes any number of arguments and returns x.
sourceraw docstring

every-predclj/s

(every-pred p & ps)

Takes a set of predicates and returns a function f that returns true if all of its composing predicates return a logical true value against all of its arguments, else it returns false. Note that f is short-circuiting in that it will stop execution on the first argument that triggers a logical false result against the original predicates.

Takes a set of predicates and returns a function f that returns true if all of its
composing predicates return a logical true value against all of its arguments, else it returns
false. Note that f is short-circuiting in that it will stop execution on the first
argument that triggers a logical false result against the original predicates.
sourceraw docstring

fnilclj/s

(fnil f x)
(fnil f x y)
(fnil f x y z)

Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched.

Takes a function f, and returns a function that calls f, replacing
a nil first argument to f with the supplied value x. Higher arity
versions can replace arguments in the second and third
positions (y, z). Note that the function f can take any number of
arguments, not just the one(s) being nil-patched.
sourceraw docstring

juxtclj/s

(juxt f & fns)

Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]

Takes a set of functions and returns a fn that is the juxtaposition
of those fns.  The returned fn takes a variable number of args, and
returns a vector containing the result of applying each fn to the
args (left-to-right).
((juxt a b c) x) => [(a x) (b x) (c x)]
sourceraw docstring

lift-variadicclj/s

(lift-variadic f & fargs)
source

partialclj/s

(partial f & args)

Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args.

Takes a function f and fewer than the normal arguments to f, and
returns a fn that takes a variable number of additional args. When
called, the returned function calls f with args + additional args.
sourceraw docstring

some-fnclj/s

(some-fn p & ps)

Takes a set of predicates and returns a function f that returns the first logical true value returned by one of its composing predicates against any of its arguments, else it returns logical false. Note that f is short-circuiting in that it will stop execution on the first argument that triggers a logical true result against the original predicates.

Takes a set of predicates and returns a function f that returns the first logical true value
returned by one of its composing predicates against any of its arguments, else it returns
logical false. Note that f is short-circuiting in that it will stop execution on the first
argument that triggers a logical true result against the original predicates.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close