Liking cljdoc? Tell your friends :D

clojure.core.reducers

A library for reduction and parallel folding. Alpha and subject to change. Note that fold and its derivatives require Java 7+ or Java 6 + jsr166y.jar for fork/join support. See Clojure's pom.xml for the dependency info.

A library for reduction and parallel folding. Alpha and subject
to change.  Note that fold and its derivatives require Java 7+ or
Java 6 + jsr166y.jar for fork/join support. See Clojure's pom.xml for the
dependency info.
raw docstring

append!clj

(append! acc x)

.adds x to acc and returns acc

.adds x to acc and returns acc
sourceraw docstring

catclj

(cat)
(cat ctor)
(cat left right)

A high-performance combining fn that yields the catenation of the reduced values. The result is reducible, foldable, seqable and counted, providing the identity collections are reducible, seqable and counted. The single argument version will build a combining fn with the supplied identity constructor. Tests for identity with (zero? (count x)). See also foldcat.

A high-performance combining fn that yields the catenation of the
reduced values. The result is reducible, foldable, seqable and
counted, providing the identity collections are reducible, seqable
and counted. The single argument version will build a combining fn
with the supplied identity constructor. Tests for identity
with (zero? (count x)). See also foldcat.
sourceraw docstring

CollFoldcljprotocol

coll-foldclj

(coll-fold coll n combinef reducef)
source

dropclj

(drop n)
(drop n coll)

Elides the first n values from the reduction of coll.

Elides the first n values from the reduction of coll.
sourceraw docstring

filterclj

(filter pred)
(filter pred coll)

Retains values in the reduction of coll for which (pred val) returns logical true. Foldable.

Retains values in the reduction of coll for which (pred val)
returns logical true. Foldable.
sourceraw docstring

fjtaskclj

(fjtask f)
source

flattenclj

(flatten)
(flatten coll)

Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat foldable collection.

Takes any nested combination of sequential things (lists, vectors,
etc.) and returns their contents as a single, flat foldable
collection.
sourceraw docstring

foldclj

(fold reducef coll)
(fold combinef reducef coll)
(fold n combinef reducef coll)

Reduces a collection using a (potentially parallel) reduce-combine strategy. The collection is partitioned into groups of approximately n (default 512), each of which is reduced with reducef (with a seed value obtained by calling (combinef) with no arguments). The results of these reductions are then reduced with combinef (default reducef). combinef must be associative, and, when called with no arguments, (combinef) must produce its identity element. These operations may be performed in parallel, but the results will preserve order.

Reduces a collection using a (potentially parallel) reduce-combine
strategy. The collection is partitioned into groups of approximately
n (default 512), each of which is reduced with reducef (with a seed
value obtained by calling (combinef) with no arguments). The results
of these reductions are then reduced with combinef (default
reducef). combinef must be associative, and, when called with no
arguments, (combinef) must produce its identity element. These
operations may be performed in parallel, but the results will
preserve order.
sourceraw docstring

foldcatclj

(foldcat coll)

Equivalent to (fold cat append! coll)

Equivalent to (fold cat append! coll)
sourceraw docstring

folderclj

(folder coll xf)

Given a foldable collection, and a transformation function xf, returns a foldable collection, where any supplied reducing fn will be transformed by xf. xf is a function of reducing fn to reducing fn.

Given a foldable collection, and a transformation function xf,
returns a foldable collection, where any supplied reducing
fn will be transformed by xf. xf is a function of reducing fn to
reducing fn.
sourceraw docstring

mapclj

(map f)
(map f coll)

Applies f to every value in the reduction of coll. Foldable.

Applies f to every value in the reduction of coll. Foldable.
sourceraw docstring

mapcatclj

(mapcat f)
(mapcat f coll)

Applies f to every value in the reduction of coll, concatenating the result colls of (f val). Foldable.

Applies f to every value in the reduction of coll, concatenating the result
colls of (f val). Foldable.
sourceraw docstring

monoidclj

(monoid op ctor)

Builds a combining fn out of the supplied operator and identity constructor. op must be associative and ctor called with no args must return an identity value for it.

Builds a combining fn out of the supplied operator and identity
constructor. op must be associative and ctor called with no args
must return an identity value for it.
sourceraw docstring

poolclj

source

reduceclj

(reduce f coll)
(reduce f init coll)

Like core/reduce except: When init is not provided, (f) is used. Maps are reduced with reduce-kv

Like core/reduce except:
When init is not provided, (f) is used.
Maps are reduced with reduce-kv
sourceraw docstring

reducerclj

(reducer coll xf)

Given a reducible collection, and a transformation function xf, returns a reducible collection, where any supplied reducing fn will be transformed by xf. xf is a function of reducing fn to reducing fn.

Given a reducible collection, and a transformation function xf,
returns a reducible collection, where any supplied reducing
fn will be transformed by xf. xf is a function of reducing fn to
reducing fn.
sourceraw docstring

removeclj

(remove pred)
(remove pred coll)

Removes values in the reduction of coll for which (pred val) returns logical true. Foldable.

Removes values in the reduction of coll for which (pred val)
returns logical true. Foldable.
sourceraw docstring

takeclj

(take n)
(take n coll)

Ends the reduction of coll after consuming n values.

Ends the reduction of coll after consuming n values.
sourceraw docstring

take-whileclj

(take-while pred)
(take-while pred coll)

Ends the reduction of coll when (pred val) returns logical false.

Ends the reduction of coll when (pred val) returns logical false.
sourceraw docstring

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

× close