(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 aggregate fn (aggrf :: accumulator -> input -> accumulator) to vector if no fn is provided.
Returns a vector of partition functions (kf :: input -> key, initf :: input -> accumulator, aggrf :: accumulator -> input -> accumulator). Adds a default aggregate fn (aggrf :: accumulator -> input -> accumulator) to vector if no fn is provided.
(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 fns.
The closure is defined with 2 arities for different purposes:
Step (arity 1) - applies all key fns 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 fns. The closure is defined with 2 arities for different purposes: Step (arity 1) - applies all key fns 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.
(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 provided.
Applies partitioner closure f to each value in coll. Returns a lazy seq of partitions. Returns a stateful transducer when no collection is provided.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |