Yield

h8io.stages.Yield
See theYield companion object
sealed trait Yield[-I, +O, +E]

What a Stage returns for one input: an optional output, the Status of that run, and the Evolution that picks the stage handling the next one.

Yield is the internal value flowing from stage to stage, not the answer the pipeline gives to the outside world — that is h8io.stages.base.Outcome in the lib module, produced once someone terminates the pipeline.

There are two variants, Yield.Some and Yield.None, according to whether an output was produced. Match on them when the two cases are handled differently, on Yield itself when they are not.

Type parameters

E

the error type (covariant)

I

the input type of the stages held by the evolution (contravariant)

O

the output type (covariant)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class None[I, O, E]
class Some[I, O, E]

Members list

Value members

Abstract methods

def map[_I, _O, _E](mapOut: O => _O, mapStatus: Status[E] => Status[_E], mapEvolution: Evolution[I, O, E] => Evolution[_I, _O, _E]): Yield[_I, _O, _E]

Transforms all three components at once. mapOut is not called on a Yield.None, which has no output to transform, but is still required so that the result type is the same for both variants.

Transforms all three components at once. mapOut is not called on a Yield.None, which has no output to transform, but is still required so that the result type is the same for both variants.

Attributes

def outOption: Option[O]

The output as an Option — for when only its presence matters. Prefer matching on Yield.Some / Yield.None when the status or the evolution is needed too.

The output as an Option — for when only its presence matters. Prefer matching on Yield.Some / Yield.None when the status or the evolution is needed too.

Attributes

Concrete methods

def evolve(): Stage[I, O, E]

The stage that handles the next input: the continuation this yield's own status selects.

The stage that handles the next input: the continuation this yield's own status selects.

Going through the evolution directly is the exception, not the rule — the status a yield carries is the one its continuation must be chosen by, and this method is what pairs them.

Attributes

Abstract fields

val evolution: Evolution[I, O, E]

The continuation: which stage handles the next input, given status.

The continuation: which stage handles the next input, given status.

Attributes

val status: Status[E]

The status of the run that produced this yield.

The status of the run that produced this yield.

Attributes