Liking cljdoc? Tell your friends :D

humilia.core


distinct-byclj

(distinct-by f)
(distinct-by f coll)

Returns a lazy sequence of the elements of coll, removing any elements that return duplicate values when passed to a function f.

Returns a lazy sequence of the elements of coll, removing any
elements that return duplicate values when passed to a function f.
raw docstring

filter-keysclj

(filter-keys pred)
(filter-keys pred coll)

Filters a MapEntry collection by the result of applying pred to the key of each entry. If you want a new map efficiently constructed, use (into {} (filter-keys f) c).

Filters a MapEntry collection by the result of applying pred to the
key of each entry. If you want a new map efficiently constructed, use
(into {} (filter-keys f) c).
raw docstring

filter-valsclj

(filter-vals pred)
(filter-vals pred coll)

Filters a MapEntry collection by the result of applying pred to the vals of each entry. If you want a new map efficiently constructed, use (into {} (filter-vals f) c).

Filters a MapEntry collection by the result of applying pred to the
vals of each entry. If you want a new map efficiently constructed, use
(into {} (filter-vals f) c).
raw docstring

group-byclj

(group-by f coll)
(group-by xform f coll)

Behaves just like clojure.core/group-by, but optionally takes an xform as first argument to transform the inputs before grouping: (group-by (map inc) even? (range 10))

Behaves just like clojure.core/group-by, but optionally takes an xform
as first argument to transform the inputs before grouping:
(group-by (map inc) even? (range 10))
raw docstring

group-likeclj

(group-like flat grouped)

(group-like [:a :b :c :d :e] [[1 2] [3 4 5]]) => [(:a :b) (:c :d :e)]

(group-like [:a :b :c :d :e] [[1 2] [3 4 5]])
=> [(:a :b) (:c :d :e)]
raw docstring

keepclj

(keep f)
(keep f coll)
(keep f coll & colls)

Returns a lazy sequence of the non-nil results of (f item). Note that this means false return values will be included. f must be free of side-effects. Returns a transducer when no collection is provided. Differs from clojure.core/keep in that it can work with multiple collections the way map can.

Returns a lazy sequence of the non-nil results of (f item). Note that this
means false return values will be included. f must be free of side-effects.
Returns a transducer when no collection is provided.
Differs from clojure.core/keep in that it can work with multiple collections
the way map can.
raw docstring

keep-keysclj

(keep-keys f)
(keep-keys f coll)

Maps a function across the keys of a MapEntry collection, dropping entries for which (f key) returns nil. Returns a sequence. If you want a new map efficiently constructed, use (into {} (keep-keys f) c).

Maps a function across the keys of a MapEntry collection, dropping
entries for which (f key) returns nil. Returns a sequence. If you want
a new map efficiently constructed, use
(into {} (keep-keys f) c).
raw docstring

keep-valsclj

(keep-vals f)
(keep-vals f coll)

Maps a function across the vals of a MapEntry collection, dropping entries for which (f val) returns nil. Returns a sequence. If you want a new map efficiently constructed, use (into {} (keep-vals f) c).

Maps a function across the vals of a MapEntry collection, dropping
entries for which (f val) returns nil. Returns a sequence. If you want
a new map efficiently constructed, use
(into {} (keep-vals f) c).
raw docstring

keepcatclj

(keepcat)
(keepcat f)
(keepcat f & colls)

mapcat : map :: keepcat : keep

mapcat : map :: keepcat : keep
raw docstring

locking-vswap!cljmacro

(locking-vswap! vol f & args)

Version of vswap! that locks the volatile.

Version of vswap! that locks the volatile.
raw docstring

map-keysclj

(map-keys f)
(map-keys f k->v)

Maps a function across the keys of a MapEntry collection. Returns a sequence. If you want a new map efficiently constructed, use (into {} (map-keys f) c).

Maps a function across the keys of a MapEntry collection. Returns
a sequence. If you want a new map efficiently constructed, use
(into {} (map-keys f) c).
raw docstring

map-valsclj

(map-vals f)
(map-vals f k->v)

Maps a function across the vals of a MapEntry collection. Returns a sequence. If you want a new map efficiently constructed, use (into {} (map-vals f) c).

Maps a function across the vals of a MapEntry collection. Returns
a sequence. If you want a new map efficiently constructed, use
(into {} (map-vals f) c).
raw docstring

merge-sortedclj

(merge-sorted cs)

Given a number of sorted collections, this returns a vector containing all the items from those collections, sorted.

Given a number of sorted collections, this returns a vector containing all the items
from those collections, sorted.
raw docstring

merge-sorted-byclj

(merge-sorted-by f cs)

Given a number of collections sorted under the projection defined by f, this returns a vector containing all the items from those collections, all sorted under the projection defined by f.

Given a number of collections sorted under the projection defined by f,
this returns a vector containing all the items from those collections, all
sorted under the projection defined by f.
raw docstring

partition-mapclj

(partition-map pred fmap coll)
(partition-map pred fmap coll & colls)

Similar to piecewise-map. This partitions the collection by the result of (pred x) for each x in coll, then applies the functions in fmap directly to the partitions whole, rather than on individual elements. Even so, the element-wise ordering is preserved. Usage: (partition-map even? {true reverse false #(map - %)} (range 10)) If a function is not specified, defaults to the value of :default in fmap; if that is not defined, defaults to identity. Supplied functions are never called on an empty partition.

Similar to piecewise-map. This partitions the collection by the result of (pred x) for
each x in coll, then applies the functions in fmap directly to the partitions whole,
rather than on individual elements. Even so, the element-wise ordering is preserved.
Usage:
(partition-map even? {true reverse false #(map - %)} (range 10))
If a function is not specified, defaults to the value of :default in fmap; if that
is not defined, defaults to identity.
Supplied functions are never called on an empty partition.
raw docstring

partition-pmapclj

(partition-pmap pred fmap coll)
(partition-pmap pred fmap coll & colls)

Similar to piecewise-map. This partitions the collection by the result of (pred x) for each x in coll, then applies the functions in fmap directly to the partitions whole, rather than mapping across them. rather than on individual elements. Even so, the element-wise ordering is preserved. Usage: (partition-map even? {true reverse false #(map - %)} (range 10)) If a function is not specified, defaults to the value of :default in fmap; if that is not defined, defaults to identity. Supplied functions are never called on an empty partition.

Similar to piecewise-map. This partitions the collection by the result of (pred x) for
each x in coll, then applies the functions in fmap directly to the partitions whole,
rather than mapping across them.
rather than on individual elements. Even so, the element-wise ordering is preserved.
Usage:
(partition-map even? {true reverse false #(map - %)} (range 10))
If a function is not specified, defaults to the value of :default in fmap; if that
is not defined, defaults to identity.
Supplied functions are never called on an empty partition.
raw docstring

piecewise-mapclj

(piecewise-map pred fmap)
(piecewise-map pred fmap coll)
(piecewise-map pred fmap coll & colls)

Declaratively defines and maps a piecewise function across a collection, with pieces split on the result of (pred x) for each x in coll. Usage: (piecewise-map even? {true inc, false dec} (range 10)) => (1 0 3 2 5 4 7 6 9 8) If a function is not specified, defaults to the value of :default in fmap; if that is not defined, defaults to identity.

Declaratively defines and maps a piecewise function across a collection, with pieces
split on the result of (pred x) for each x in coll. Usage:
(piecewise-map even? {true inc, false dec} (range 10))
=> (1 0 3 2 5 4 7 6 9 8)
If a function is not specified, defaults to the value of :default in fmap; if that
is not defined, defaults to identity.
raw docstring

piecewise-pmapclj

(piecewise-pmap pred fmap coll)
(piecewise-pmap pred fmap coll & colls)

Declaratively defines and maps a piecewise function across a collection, with pieces split on the result of (pred x) for each x in coll. Usage: (piecewise-map even? {true inc, false dec} (range 10)) => (1 0 3 2 5 4 7 6 9 8) If a function is not specified, defaults to the value of :default in fmap; if that is not defined, defaults to identity.

Declaratively defines and maps a piecewise function across a collection, with pieces
split on the result of (pred x) for each x in coll. Usage:
(piecewise-map even? {true inc, false dec} (range 10))
=> (1 0 3 2 5 4 7 6 9 8)
If a function is not specified, defaults to the value of :default in fmap; if that
is not defined, defaults to identity.
raw docstring

reduce-indexedclj

(reduce-indexed f coll)
(reduce-indexed f val coll)

Similar to map-indexed. The reducing function should take args [res idx val]. More or less equivalent to (reduce-kv f (vec coll)), which would rely on the fact that vectors are indexed.

Similar to map-indexed. The reducing function should take args [res idx val].
More or less equivalent to (reduce-kv f (vec coll)), which would rely on the fact
that vectors are indexed.
raw docstring

remove-keysclj

(remove-keys pred)
(remove-keys pred coll)

Returns a lazy sequence of the MapEntries in coll for which (pred item) returns a falsey value. pred must be free of side effects. Returns a transducer when no collection is provided.

Returns a lazy sequence of the MapEntries in coll for which
(pred item) returns a falsey value. pred must be free of side
effects. Returns a transducer when no collection is provided.
raw docstring

remove-valsclj

(remove-vals pred)
(remove-vals pred coll)

Returns a lazy sequence of the MapEntries in coll for which (pred item) returns a falsey value. pred must be free of side effects. Returns a transducer when no collection is provided.

Returns a lazy sequence of the MapEntries in coll for which
(pred item) returns a falsey value. pred must be free of side
effects. Returns a transducer when no collection is provided.
raw docstring

sorted-zipmapclj

(sorted-zipmap keys vals)
(sorted-zipmap fn keys vals)

Exactly like zipmap, except the resulting map is sorted. Optionally accepts a comparator. Motivation: faster than zipmapping then sorting.

Exactly like zipmap, except the resulting map is sorted. Optionally accepts a comparator.
Motivation: faster than zipmapping then sorting.
raw docstring

thread-localcljmacro

(thread-local & body)

Takes a body of expressions, and returns a java.lang.ThreadLocal object. (see http://download.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html). To get the current value of the thread-local binding, you must deref (@) the thread-local object. The body of expressions will be executed once per thread and future derefs will be cached. Note that while nothing is preventing you from passing these objects around to other threads (once you deref the thread-local, the resulting object knows nothing about threads), you will of course lose some of the benefit of having thread-local objects.

Takes a body of expressions, and returns a java.lang.ThreadLocal object.
 (see http://download.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html).
To get the current value of the thread-local binding, you must deref (@) the
thread-local object. The body of expressions will be executed once per thread
and future derefs will be cached.
Note that while nothing is preventing you from passing these objects around
to other threads (once you deref the thread-local, the resulting object knows
nothing about threads), you will of course lose some of the benefit of having
thread-local objects.
raw docstring

thread-local*clj

(thread-local* init)

Non-macro version of thread-local - see documentation for same.

Non-macro version of thread-local - see documentation for same.
raw docstring

zipclj

(zip f1 f2)
(zip f1 f2 c)
(zip f1 f2 c & cs)

Zips two functions across the input collection(s). Returns a MapEntry sequence. Returns a transducer if no collection(s) are provided. Similar to (map juxt).

Zips two functions across the input collection(s). Returns a MapEntry sequence.
Returns a transducer if no collection(s) are provided. Similar to (map juxt).
raw docstring

zip-fromclj

(zip-from c)

Stateful transducer. Create with collection c. Returns a MapEntry seq [c-1 input-1] [c-2 input-2] ... until c is empty or inputs are exhausted.

Stateful transducer. Create with collection c.
Returns a MapEntry seq [c-1 input-1] [c-2 input-2] ... until c is empty or
inputs are exhausted.
raw docstring

zip-toclj

(zip-to c)

Stateful transducer. Create with collection c. Returns a MapEntry seq [input-1 c-1] [input-2 c-2] ... until c is empty or inputs are exhausted.

Stateful transducer. Create with collection c.
Returns a MapEntry seq [input-1 c-1] [input-2 c-2] ... until c is empty or
inputs are exhausted.
raw docstring

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

× close