Liking cljdoc? Tell your friends :D
Clojure only.

pold.core


partclj

(part kf aggrf)
(part kf initf accf)

Returns a vector of partition functions (kf :: input -> key, initf :: input -> accumulator, aggrf :: accumulator -> input -> accumulator). Adds a default identity function for aggregation if no aggregation function is given.

Returns a vector of partition functions (kf :: input -> key,
initf :: input -> accumulator, aggrf :: accumulator -> input -> accumulator).
Adds a default identity function for aggregation if no aggregation function
is given.
sourceraw docstring

partitionerclj

(partitioner [kf initf aggrf] & more)

Takes a set of partition functions (kf :: input -> key, initf :: input -> accumulator, aggrf :: accumulator -> input -> accumulator) and returns a stateful closure that is the composition of those functions.

The closure is defined with 2 arities for different purposes:

Step (arity 1) - applies all key functions to input and splitting it each time a new value is returned. If a key changes an accumulator is created by applying initf to input. Otherwise the accumulator is updated by appyling aggrf. Returns accumulator of first partition if first key changes, otherwise :pold.core/nothing.

Completion (artity 0) - used to flush element at the end of the input. Returns :pold.core/nothing if no element is left, otherwise the accumulator of the first partition.

Takes a set of partition functions (kf :: input -> key,
initf :: input -> accumulator, aggrf :: accumulator -> input -> accumulator)
and returns a stateful closure that is the composition of those functions.

The closure is defined with 2 arities for different purposes:

Step (arity 1) - applies all key functions to input and splitting it each
time a new value is returned. If a key changes an accumulator is created by
applying initf to input. Otherwise the accumulator is updated
by appyling aggrf. Returns accumulator of first partition if first key
changes, otherwise :pold.core/nothing.

Completion (artity 0) - used to flush element at the end of the input.
Returns :pold.core/nothing if no element is left, otherwise the accumulator
of the first partition.
sourceraw docstring

poldclj

(pold f)
(pold f coll)

Applies partitioner closure f to each value in coll. Returns a lazy seq of partitions. Returns a stateful transducer when no collection is given.

Applies partitioner closure f to each value in coll. Returns a lazy seq of
partitions. Returns a stateful transducer when no collection is given.
sourceraw docstring

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

× close