Decides whether the Sink should continue from the current state.
Produces a final value of type B
along with a remainder of type Chunk[A0]
.
The initial state of the sink.
Steps through one iteration of the sink.
Operator alias for zipParRight
Operator alias for zipRight
Operator alias for zipLeft
Operator alias for zipPar
.
Operator alias for zipLeft
Operator alias for zip
Operator alias for orElse
for two sinks consuming and producing values of the same type.
Creates a sink that always produces c
Replaces any error produced by this sink.
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
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.
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
Performs the specified effect for every element that is consumed by this sink.
Performs the specified effect for every element that is produced by this sink.
Times the invocation of the sink
Creates a sink that ignores all produced elements.
Sets the initial state of the sink to the provided state.
Runs two sinks in unison and matches produced values pair-wise.
Runs two sinks in unison and keeps only values on the left.
Runs both sinks in parallel on the input and combines the results into a Tuple.
Runs both sinks in parallel on the input and combines the results into a Tuple.
Runs both sinks in parallel on the input and combines the results into a Tuple.
Runs two sinks in unison and keeps only values on the right.
Runs two sinks in unison and merges values pair-wise.
Runs both sinks in parallel on the input and combines the results using the provided function.
A named alias for race
.
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.