RightProjection

h8io.stages.base.RightProjection
trait RightProjection[C[_, _]] extends Projection[C[Any, Any], Any]

A Projection for the right side of a covariant binary type constructor C[+_, +_].

Mirror of LeftProjection for the right type parameter.

Type parameters

C

the binary type constructor (must be covariant in both type parameters)

Attributes

Graph
Supertypes
trait Projection[C[Any, Any], Any]
trait StaticStage[C[Any, Any], Any, Nothing]
trait SAMStage[C[Any, Any], Any, Nothing]
trait Stagnation[C[Any, Any], Any, Nothing]
trait Evolution[C[Any, Any], Any, Nothing]
trait Stage[C[Any, Any], Any, Nothing]
trait C[Any, Any] => Yield[C[Any, Any], Any, Nothing]
class Object
trait Matchable
class Any
Show all
Known subtypes
object Right
object Valid
object Right
object Right

Members list

Value members

Concrete methods

final def apply[T]: Projection[C[Any, T], T]

Returns a typed view of this projection for right-side values of type T.

Returns a typed view of this projection for right-side values of type T.

Type parameters

T

the concrete right-side type

Attributes

Returns

this projection typed as Projection[C[Any, T], T]

Inherited methods

def andThen[A](g: Yield[C[Any, Any], Any, Nothing] => A): C[Any, Any] => A

Composes two instances of Function1 in a new Function1, with this function applied first.

Composes two instances of Function1 in a new Function1, with this function applied first.

Type parameters

A

the result type of function g

Value parameters

g

a function R => A

Attributes

Returns

a new function f such that f(x) == g(apply(x))

Inherited from:
Function1
final override def apply(in: C[Any, Any]): Yield[C[Any, Any], Any, Nothing]

Processes in and returns the Yield carrying the optional output, the status and the continuation.

Processes in and returns the Yield carrying the optional output, the status and the continuation.

A stage that throws from here must have released its own resources first — see the ''Lifecycle'' section above.

Attributes

Definition Classes
StaticStage -> Stage -> Function1
Inherited from:
StaticStage
final def compose[_O, _E >: Nothing](that: Evolution[Any, _O, _E]): Evolution[C[Any, Any], _O, _E]

Composes this evolution with the one downstream of it, so that for every status

Composes this evolution with the one downstream of it, so that for every status

 composed(s) == self(s) ~> that(s)

This is how Yield composition carries both continuations of a pipeline forward; application code rarely calls it directly.

Attributes

Inherited from:
Evolution
def compose[A](g: A => C[Any, Any]): A => Yield[C[Any, Any], Any, Nothing]

Composes two instances of Function1 in a new Function1, with this function applied last.

Composes two instances of Function1 in a new Function1, with this function applied last.

Type parameters

A

the type to which function g can be applied

Value parameters

g

a function A => T1

Attributes

Returns

a new function f such that f(x) == apply(g(x))

Inherited from:
Function1
override def dispose(): Unit

Releases everything held by the Stage that produced this evolution. That stage is permanently unusable afterwards — neither applied nor skipped again — and this is the only place its resources are released.

Releases everything held by the Stage that produced this evolution. That stage is permanently unusable afterwards — neither applied nor skipped again — and this is the only place its resources are released.

Whoever terminates a pipeline is responsible for disposing the evolution of the final Yield, so that the continuation is released at once instead of being carried around. The reference terminal driver is the execute extension method of h8io.stages.base in the lib module.

dispose() stays valid after evolve has been called on the same instance, and must then release everything still alive, including whatever building the continuation acquired. evolve hands over no ownership: this evolution remains the cleanup point for its lineage until the continuation has run and produced an evolution of its own, which takes the role over from that moment.

Exceptions are not part of this contract: a stage whose apply throws produces no yield and therefore no evolution, so there is nothing to dispose — it must clean up after itself (see the ''Lifecycle'' section in Stage).

A no-op is a fine implementation for a stage holding nothing external.

Attributes

Definition Classes
Inherited from:
Stagnation
final override def evolve(status: Status[_]): Stage[C[Any, Any], Any, Nothing]

The next stage, for the given status.

The next stage, for the given status.

May release what belongs to this generation alone — anything the returned stage and its own evolution will not reuse.

evolve and dispose are not mutually exclusive. Usually only one of them is called on an instance: a terminal driver disposes, a continuing pipeline evolves and drops the previous evolution. But a caller may do both, and operators owning their inner stage (Loop, Repeat and the rest of h8io.stages.cycles in the lib module) do exactly that — they evolve eagerly and keep the inner dispose as the cleanup handle of the generation they just built.

Attributes

Definition Classes
Inherited from:
Stagnation
final def map[_I, _O, _E](f: Stage[C[Any, Any], Any, Nothing] => Stage[_I, _O, _E]): Evolution[_I, _O, _E]

Applies f to every stage this evolution would return, leaving disposal delegated to it unchanged.

Applies f to every stage this evolution would return, leaving disposal delegated to it unchanged.

The way an operator keeps its wrapping in place across generations: the continuation comes back wrapped the same way the current stage is.

Attributes

Inherited from:
Evolution
final override def skip(): Evolution[C[Any, Any], Any, Nothing]

Returns this stage's Evolution without consuming an input.

Returns this stage's Evolution without consuming an input.

Called instead of apply whenever the stage takes part in a run but has nothing to process: the upstream yielded no output, or a binary operator excluded this branch. The evolution must be the one the stage would have returned had it run. Like apply, skip() may perform side effects — a decorator, for instance, may advance or release the inner stage it owns.

Attributes

Definition Classes
Inherited from:
SAMStage
protected def some(out: Any): Some[Any, Nothing]

Creates a successful h8io.stages.Yield.Some carrying out.

Creates a successful h8io.stages.Yield.Some carrying out.

Attributes

Inherited from:
Projection
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1
final def ~>[_O, _E >: Nothing](that: Stage[Any, _O, _E]): Stage[C[Any, Any], _O, _E]

Composes this stage with that, feeding this stage's output into it. See the ''Composition'' section above for what happens when there is no output to feed.

Composes this stage with that, feeding this stage's output into it. See the ''Composition'' section above for what happens when there is no output to feed.

Attributes

Inherited from:
Stage

Inherited fields

protected val none: None[Nothing]

A pre-built h8io.stages.Yield.None used when the container holds no value for this projection.

A pre-built h8io.stages.Yield.None used when the container holds no value for this projection.

Attributes

Inherited from:
Projection