Runs the sink from an initial state and produces a final value
of type B
The initial state of the sink.
Steps through one iteration of the sink
Operator alias for zipRight
Operator alias for zipLeft
Operator alias for zip
Operator alias for orElse
for two sinks consuming and producing values of the same type.
Returns a new sink that tries to produce the B
, but if there is an
error in stepping or extraction, produces None
.
Takes a Sink
, and lifts it to be chunked in its input and output.
Takes a Sink
, and lifts it to be chunked in its input and output. This
will not improve performance, but can be used to adapt non-chunked sinks
wherever chunked sinks are required.
Accumulates the output into a list.
Accumulates the output into a list of maximum size i
.
Accumulates into a list for as long as incoming values verify predicate p
.
Accumulates into a value of type S
for as long as incoming values verify predicate p
.
Accumulates the output into a value of type S
.
Creates a sink that always produces c
Creates a sink where every element of type A
entering the sink is first
transformed by f
Creates a sink where every element of type A
entering the sink is first
transformed by the effectful f
Creates a sink that transforms entering values with f
and
outgoing values with g
Drops all elements entering the sink for as long as the specified predicate
evaluates to true
.
Filters the inputs fed to this sink.
Effectfully filters the inputs fed to this sink.
Filters this sink by the specified predicate, dropping all elements for which the predicate evaluates to true.
Effectfully ilters this sink by the specified predicate, dropping all elements for which the predicate evaluates to true.
Creates a sink producing values of type C
obtained by each produced value of type B
transformed into a sink by f
.
Maps the value produced by this sink.
Maps any error produced by this sink.
Effectfully maps the value produced by this sink.
Maps the remainder produced after this sink is done.
A named alias for ?
.
Runs both sinks in parallel on the same input.
Runs both sinks in parallel on the same input. If the left one succeeds,
its value will be produced. Otherwise, whatever the right one produces
will be produced. If the right one succeeds before the left one, it
accumulates the full input until the left one fails, so it can return
it as the remainder. This allows this combinator to function like choice
in parser combinator libraries.
Left: ============== FAIL! Right: ===== SUCCEEDS! xxxxxxxxx <- Should NOT be consumed
Narrows the environment by partially building it with f
Runs both sinks in parallel on the input, returning the result from the one that finishes successfully first.
Runs both sinks in parallel on the input, returning the result from the one that finishes successfully first.
Steps through a chunk of iterations of the sink
Produces a sink consuming all the elements of type A
as long as
they verify the predicate pred
.
Creates a sink that ignores all produced elements.
Creates a sink that produces values until one verifies
the predicate f
.
Runs two sinks in unison and matches produced values pair-wise.
Runs two sinks in unison and keeps only values on the left.
Runs two sinks in unison and keeps only values on the right.
Runs two sinks in unison and merges values pair-wise.
A named alias for race
.
(Since version 1.0.0) use unit
(Since version 1.0.0) use <*>
A
Sink[E, A0, A, B]
consumes values of typeA
, ultimately producing either an error of typeE
, or a value of typeB
together with a remainder of typeA0
.Sinks form monads and combine in the usual ways.