Liking cljdoc? Tell your friends :D

clambda.core


iterator-reducibleclj

(iterator-reducible iter)

Similar to clojure.core/iterator-seq, but returns something reducible instead of a lazy-seq.

Similar to `clojure.core/iterator-seq`,
but returns something reducible instead of a lazy-seq.
sourceraw docstring

jlambdaclj

(jlambda t f)

Convenience wrapper-fn around clambda.jlambda/jlambda. Type-hinting at the call site may be required (to avoid reflection).

Convenience wrapper-fn around `clambda.jlambda/jlambda`.
Type-hinting at the call site may be required (to avoid reflection).
sourceraw docstring

lines-reducibleclj

(lines-reducible r)

Similar to clojure.core/line-seq, but returns something reducible instead of a lazy-seq.

Similar to `clojure.core/line-seq`, but
returns something reducible instead of a lazy-seq.
sourceraw docstring

rf-someclj

(rf-some)
(rf-some x)
(rf-some _ x)

Reducing cousin of clojure.core/some.

Reducing cousin of `clojure.core/some`.
sourceraw docstring

seq-streamclj

(seq-stream s)
(seq-stream s lazy-split)
(seq-stream s lazy-split parallel?)

Returns a java Stream wrapping a clojure Seq. The usefulness of this constructor-fn is minimal (to none) for Clojure users. If you're writing Java, it is conceivable that you may want/have to consume a Clojure data-structure, and in such cases it is only natural to want to write your code in terms of streams. WARNING: Only vectors are cheaply splittable, so in general avoid forcefully parallelizing, unless you know what you're doing.

Returns a java Stream wrapping a clojure Seq.
The usefulness of this constructor-fn is minimal (to none) for Clojure users.
If you're writing Java, it is conceivable that you may want/have to consume a Clojure
data-structure, and in such cases it is only natural to want to write your code
in terms of streams.
WARNING: Only vectors are cheaply splittable, so in general avoid forcefully parallelizing,
unless you know what you're doing.
sourceraw docstring

stream-intoclj

(stream-into to stream)
(stream-into to xform stream)

A 'collecting' transducing context (like clojure.core/into), for Java Streams. Useful for pouring streams into clojure data-structures without involving an intermediate Collection, with the added bonus of being able apply a transducer along the way. Parallel streams are supported, but there are two caveats. First of all <to> MUST be either empty, or something that can handle duplicates (e.g a set), because it will become the <init> for more than one reductions. Be AWARE & CAUTIOUS! Secondly, Stream.reduce()requires that the reduction does not mutate the values received as arguments to combine. Therefore, conj has to be the reducing fn per parallel reduction, leaving conj! (via into) for the 'outer' combining. For serial streams we can go fully mutably (much like .collect() does).

A 'collecting' transducing context (like `clojure.core/into`), for Java Streams.
Useful for pouring streams into clojure data-structures
without involving an intermediate Collection, with the added bonus
of being able apply a transducer along the way.
Parallel streams are supported, but there are two caveats. First of all <to> MUST be
either empty, or something that can handle duplicates (e.g a set), because it will become
the <init> for more than one reductions. Be AWARE & CAUTIOUS!
Secondly, `Stream.reduce()`requires that the reduction does not mutate the values
received as arguments to combine. Therefore, `conj` has to be the reducing fn per
parallel reduction, leaving `conj!` (via `into`) for the 'outer' combining.
For serial streams we can go fully mutably (much like `.collect()` does).
sourceraw docstring

stream-reducibleclj

(stream-reducible s)
(stream-reducible s combinef)

Turns a Stream into something reducible, and optionally short-circuiting (via the 3-arg overload).

Turns a Stream into something reducible,
and optionally short-circuiting (via the 3-arg overload).
sourceraw docstring

stream-seqclj

(stream-seq s)

Returns a Seq wrapping a java Stream (via its Iterator).

Returns a Seq wrapping a java Stream (via its Iterator).
sourceraw docstring

stream-someclj

(stream-some xform stream)
(stream-some combine-f xform stream)

A short-circuiting transducing context for Java streams (parallel or not). For sequential Streams, rather similar to .findFirst() in terms of Streams, or clojure.core/some in terms of lazy-seqs. For parallel Streams, more like .findAny(), with the added bonus of aborting the search on the 'other' threads as soon as an answer is found on 'some' thread.

A short-circuiting transducing context for Java streams (parallel or not).
For sequential Streams, rather similar to `.findFirst()` in terms of Streams,
or `clojure.core/some` in terms of lazy-seqs. For parallel Streams, more
like `.findAny()`, with the added bonus of aborting the search on the
'other' threads as soon as an answer is found on 'some' thread.
sourceraw docstring

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

× close