(append coll)
Append a set of raw data to the result of the transducer when the source data is completed. The data will not flow through any of the previous transducers in the chain, but will be processed by any subsquent ones.
Sort of like cat or concat
Append a set of raw data to the result of the transducer when the source data is completed. The data will not flow through any of the previous transducers in the chain, but will be processed by any subsquent ones. Sort of like cat or concat
(branch & xforms)
Allow a single chain of transducers to branch data out to be processed by multiple transducers, then merged back into a single one.
The results of each of the branching xforms are merged into the resulting output in round-robin fashion. If any of the xforms produces multiple results for a single input, they will be sequential in the output.
If an xform produces data when it is completed, that data will be included at the end of the result stream.
The data pipeline looks something like this:
(comp pre-xform (branch xform0 xform1 xform2) post-xform)
,--> xform0 >--.
pre-xform >------> xform1 >--->(round-robin merge)--> post-xform `--> xform2 >--'
Allow a single chain of transducers to branch data out to be processed by multiple transducers, then merged back into a single one. The results of each of the branching xforms are merged into the resulting output in round-robin fashion. If any of the xforms produces multiple results for a single input, they will be sequential in the output. If an xform produces data when it is completed, that data will be included at the end of the result stream. The data pipeline looks something like this: (comp pre-xform (branch xform0 xform1 xform2) post-xform) ,--> xform0 >--. pre-xform >------> xform1 >--->(round-robin merge)--> post-xform `--> xform2 >--'
(cond-branch & pred-xform-pairs)
Will route data down the first path whose predicate is truthy. The results are merged.
Predicates are regular functions. They are called on each element that flows into this transducer until one of the predicates passes, causing the data to be routed down that predicate's xform.
Will route data down the first path whose predicate is truthy. The results are merged. Predicates are regular functions. They are called on each element that flows into this transducer until one of the predicates passes, causing the data to be routed down that predicate's xform.
(counted xform coll)
Return the count of elements in the result rather than the result itself.
Return the count of elements in the result rather than the result itself.
(distinct-by)
(distinct-by key)
(distinct-by f coll)
Removes duplicates based on the return value of key.
Removes duplicates based on the return value of key.
(doprocess xform coll)
Like dorun for a transducer. Produces no intermediate sequence at all.
Like dorun for a transducer. Produces no intermediate sequence at all.
(duplicates-by)
(duplicates-by key)
(duplicates-by f coll)
Return duplicated nodes based on the return value of key.
Empty result means no dups.
Return duplicated nodes based on the return value of key. Empty result means no dups.
(group-by-count)
(group-by-count f)
Return a map of {count [all keys with that unique count]}
Return a map of {count [all keys with that unique count]}
(group-count)
(group-count f)
Return a map of {item count-equal-items} or {(f item) count-equal}.
Arity 1 is basically identical to frequencies
.
Return a map of {item count-equal-items} or {(f item) count-equal}. Arity 1 is basically identical to `frequencies`.
(grouped-by f & {:keys [extract on-value on-map keys? flat?] :or {keys? true}})
A transducer that acts like group-by but includes the result as a single result in the stream.
Options:
:extract fn (grouped-by f :extract extract) is like this library's (group-by-extract f extract coll).
:on-value fn apply a function to the final value (after extract is completed)
:on-map fn apply a function to the final map (after extract and on-value are completed)
:keys? false (grouped-by f :keys? false) is like (vals (group-by f coll)) after extract, on-value and on-map
:flat? false like :keys? false, but catenates each value into the result after extract, on-value and on-map
A transducer that acts like group-by but includes the result as a single result in the stream. Options: :extract fn (grouped-by f :extract extract) is like this library's (group-by-extract f extract coll). :on-value fn apply a function to the final value (after extract is completed) :on-map fn apply a function to the final map (after extract and on-value are completed) :keys? false (grouped-by f :keys? false) is like (vals (group-by f coll)) after extract, on-value and on-map :flat? false like :keys? false, but catenates each value into the result after extract, on-value and on-map
(lasts-by)
(lasts-by f)
(lasts-by f coll)
A transducer that accomplishes the following but more efficiently (->> coll (group_by f) (map (fn [[k vals]] (last vals))))
A transducer that accomplishes the following but more efficiently (->> coll (group_by f) (map (fn [[k vals]] (last vals))))
(lookahead xform)
(lookahead {:keys [min max]} xform)
Uses a nested transducer as the lookahead body
Uses a nested transducer as the lookahead body
(map* xform)
(map* empty-coll xform)
(map* empty-coll item-seq xform)
Map over the elements in a sequence of sequences.
For instance in fermor (out-e*) produces a vector of edges for each node. This would let you work with those edges without flattening the vectors.
Args: xform: a transducer compatible with the sequence type ie (map ...) if each item is a sequence empty-coll: a function that produces the sequence given to into for each item item-seq: a function that coerces each item into the type of sequence you want
Map over the elements in a sequence of sequences. For instance in fermor (out-e*) produces a vector of edges for each node. This would let you work with those edges without flattening the vectors. Args: xform: a transducer compatible with the sequence type ie (map ...) if each item is a sequence empty-coll: a function that produces the sequence given to into for each item item-seq: a function that coerces each item into the type of sequence you want
(merged xform coll)
If the xform produces only one or more maps, return them merged into a single map.
If the xform produces only one or more maps, return them merged into a single map.
(neg-lookahead xform)
(neg-lookahead {:keys [min max]} xform)
Ensure that the function does NOT produce a collection of at least one item.
Use the arity 2 version to specify that there must NOT be at least min and/or at most max items in the route. If min or max is nil that limit will not be enforced. The arity 2 version of neg-lookahead is not really recommended as it is a little bit confusing.
Ensure that the function does NOT produce a collection of at least one item. Use the arity 2 version to specify that there must NOT be at least min and/or at most max items in the route. If min or max is nil that limit will not be enforced. The arity 2 version of neg-lookahead is not really recommended as it is a little bit confusing.
(rf-branchable rf)
Helper to adapt a reducing function to a branching transducer.
Don't pass the completing of the rf through because completing multiple times is invalid and this transducer will do that after its child xforms have been completed.
Helper to adapt a reducing function to a branching transducer. Don't pass the completing of the rf through because completing multiple times is invalid and this transducer will do that after its child xforms have been completed.
(section xform)
Group the results of transforming each element into a collection per-element.
Not a transducer.
Group the results of transforming each element into a collection per-element. Not a transducer.
(section-map xform coll)
(sorted)
(sorted-by)
(sorted-by f)
(sorted-group-by-count)
(sorted-group-by-count f)
Return a map of {count [all keys with that unique count]}
Return a map of {count [all keys with that unique count]}
(sorted-group-count)
(sorted-group-count f)
Return a map of {item count-equal-items} or {(f item) count-equal}
Return a map of {item count-equal-items} or {(f item) count-equal}
(when-duplicated-by)
(when-duplicated-by key)
(when-duplicated-by f coll)
Return only the first duplicated node based on the return value of key.
Nil result means no dups.
Return only the first duplicated node based on the return value of key. Nil result means no dups.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close