Packages

package base

Type aliases used throughout the lib module for describing stage transformations.

// A decorator wraps a Stage[I, O, E] and returns another Stage[I, O, E]:
val myDecorator: Decorator[String, Int, Nothing] = CompleteIfNone(_)

// An alteration converts any Stage to a (possibly different) Stage:
val myAlt: Alteration[Stage[String, Int, Nothing], Stage[String, Option[Int], Nothing]] = Lift(_)
Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. base
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Alteration[-IS <: Any, +OS <: Any] = (IS) => OS

    A function that transforms one stage type into another.

  2. trait Alterator[+S <: Any, -I, +O, +E] extends Stage[I, O, E]

    A h8io.stages.Stage that wraps another stage (the alterand).

    A h8io.stages.Stage that wraps another stage (the alterand).

    Alterator is the base trait for all unary operators and decorators that modify the behavior of a single inner stage. Resource disposal is the responsibility of the h8io.stages.Evolution returned by apply or skip — concrete subclasses must ensure their evolution delegates dispose to alterand's evolution.

    Do not mix Alterator with traits that introduce independent state or their own apply/evolution logic (e.g. SAMStage or similar mixins). Alterator assumes that alterand owns all resources: if a co-mixed trait provides its own skip or evolution without coordinating with alterand, those resources will not be released and the evolution transitions will be ignored.

    S

    the concrete type of the wrapped stage (covariant)

    I

    the input type (contravariant)

    O

    the output type (covariant)

    E

    the error type (covariant)

  3. type BaseBinaryOperator[-I, +LO, +RO, +O, +E] = BinaryOperator[Stage[I, LO, E], Stage[I, RO, E], I, O, E]
  4. trait BinaryOperator[+LS <: Stage[I, _, _], +RS <: Stage[I, _, _], -I, +O, +E] extends Stage[I, O, E]

    A h8io.stages.Stage that composes two sub-stages operating on the same input type.

    A h8io.stages.Stage that composes two sub-stages operating on the same input type.

    BinaryOperator provides exception-safe disposal of both sub-stages: right.dispose() is called first, then left.dispose(). If right.dispose() throws, left.dispose() is still attempted and any exception it throws is attached as a suppressed exception to the primary one.

    Concrete subclasses (e.g. h8io.stages.operators.And, h8io.stages.operators.Or, h8io.stages.operators.IAnd) implement apply to define how the two sub-stages are combined.

    LS

    the type of the left sub-stage (covariant, must accept input I)

    RS

    the type of the right sub-stage (covariant, must accept input I)

    I

    the shared input type (contravariant)

    O

    the combined output type (covariant)

    E

    the error type (covariant)

  5. final case class ConstEvolution[-I, +O, +E](stage: Stage[I, O, E], _dispose: () => Unit) extends Evolution[I, O, E] with Product with Serializable

    An Evolution that returns the same constant Stage regardless of the status.

    An Evolution that returns the same constant Stage regardless of the status.

    Used by StageOps.toEvolution to lift a stateless stage into an evolution.

    I

    the input type (contravariant)

    O

    the output type (covariant)

    E

    the error type (covariant)

    stage

    the stage returned by every branch

  6. type Decoration[I, O, E] = (Stage[I, O, E]) => Stage[I, O, E]

    An Alteration that transforms a Stage[I, O, E] into another Stage[I, O, E] of the same type — the standard function shape passed to h8io.stages.Evolution.map.

  7. type Decorator[-I, +O, +E] = Alterator[Stage[I, O, E], I, O, E]

    A UnaryOperator that wraps a Stage[I, O, E] and preserves its type — the standard shape for decorators (e.g.

    A UnaryOperator that wraps a Stage[I, O, E] and preserves its type — the standard shape for decorators (e.g. h8io.stages.operators.CompleteIfNone, h8io.stages.operators.KeepLastOutput).

  8. trait Fn[-I, +O] extends Fruitful[I, O, Nothing] with SAMStage[I, O, Nothing]

    The simplest way to create a Stage from a single pure function.

    The simplest way to create a Stage from a single pure function.

    Extend Fn and implement f; everything else — wrapping in Yield.Some, attaching Status.Success, wiring the evolution — is handled automatically. Fn always succeeds and returns this as the evolution (via Stagnation), making it stateless and reusable.

    Because apply is sealed, a Fn stage can never produce Yield.None or a non-Success status. When either of those is needed, use StaticStage instead.

    Example usage:

    object DoubleInt extends Fn[Int, Int] {
      def f(in: Int): Int = in * 2
    }
    I

    the input type (contravariant)

    O

    the output type (covariant)

  9. trait Fruitful[-I, +O, +E] extends Stage[I, O, E]

    A Stage that is guaranteed to always produce a h8io.stages.Yield.Some.

    A Stage that is guaranteed to always produce a h8io.stages.Yield.Some.

    Overriding apply to return Yield.Some (instead of the broader Yield) lets the compiler track this guarantee statically, making Fruitful stages safe to use wherever an output value is always expected.

    I

    the input type (contravariant)

    O

    the output type (covariant)

    E

    the error type (covariant)

  10. trait LeftProjection[C[+_, +_]] extends Projection[C[Any, _], Any]

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

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

    The singleton instance operates on C[Any, ?] and can be safely cast to any specific Projection[C[T, ?], T] via the apply[T] method.

    C

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

  11. trait Projection[-I, O] extends StaticStage[I, O, Nothing]

    Base trait for stages that extract a value from a container type C.

    Base trait for stages that extract a value from a container type C.

    A Projection either succeeds (h8io.stages.Yield.Some) when the expected value is present, or produces a h8io.stages.Yield.None (with h8io.stages.Status.Success) when it is absent — preserving the overall pipeline status without signaling an error.

    Helper values some and none are pre-built with Status.Success and this as the evolution, ready for use in apply implementations of concrete projections.

    I

    the container input type (contravariant)

    O

    the extracted value type

  12. trait RightProjection[C[+_, +_]] extends Projection[C[_, Any], Any]

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

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

    Mirror of LeftProjection for the right type parameter.

    C

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

  13. trait SAMStage[-I, +O, +E] extends Stage[I, O, E] with Stagnation[I, O, E]

    A Stage with a default implementation of skip.

    A Stage with a default implementation of skip.

    skip returns this, so every status branch of the evolution evaluates to this. A skipped SAMStage is therefore indistinguishable from an active one that evolves back to itself. This is appropriate for stateless or self-contained stages (e.g. h8io.stages.std.Complete, h8io.stages.std.GlobalSoftDeadline) that carry no external resources and always use the same instance as the next stage.

    dispose is a no-op by default. Override it when the stage holds external resources that must be released (see h8io.stages.std.DeadEnd for an example).

    I

    the input type (contravariant)

    O

    the output type (covariant)

    E

    the error type (covariant)

  14. trait SafeStage[-I, +O, +E] extends Stage[I, O, E]

    A h8io.stages.Stage that separates normal execution from exception recovery.

    A h8io.stages.Stage that separates normal execution from exception recovery.

    SafeStage seals apply and dispatches to body for the happy path. If body throws a non-fatal exception (anything matched by scala.util.control.NonFatal), recover is called instead. Fatal exceptions (e.g., OutOfMemoryError) are not caught and propagate normally.

    Concrete classes implement body for the normal case and recover to convert exceptions into an appropriate h8io.stages.Yield (typically a h8io.stages.Yield.None with an error status).

    I

    the input type (contravariant)

    O

    the output type (covariant)

    E

    the error type (covariant)

  15. implicit final class StageOps[I, O, E] extends AnyVal

    Extension methods for Stage.

  16. trait Stagnation[-I, +O, +E] extends Evolution[I, O, E]

    An h8io.stages.Evolution that always returns itself as the next stage.

    An h8io.stages.Evolution that always returns itself as the next stage.

    Mixing in Stagnation fixes evolve to unconditionally return this, regardless of the h8io.stages.Status passed in, and makes dispose a no-op. The stage is therefore stateless with respect to evolution: every pipeline run produces the same continuation.

    Appropriate for stages that hold no external resources and whose behavior does not depend on the outcome of previous runs. See SAMStage and StaticStage for concrete mixins built on top of Stagnation.

    I

    the input type (contravariant)

    O

    the output type (covariant)

    E

    the error type (covariant)

  17. trait StaticStage[-I, +O, +E] extends SAMStage[I, O, E]

    A h8io.stages.Stage that is its own Evolution.

    A h8io.stages.Stage that is its own Evolution.

    StaticStage seals apply and skip, delegating the actual processing logic to process. apply wraps the StaticYield returned by process into a full h8io.stages.Yield with this as the evolution; skip returns this directly.

    Mixing in StaticStage is appropriate when the stage does not change between runs and holds no external resources. See Fn for the further-constrained variant that always produces an output with h8io.stages.Status.Success.

    I

    the input type (contravariant)

    O

    the output type (covariant)

    E

    the error type (covariant)

  18. sealed trait StaticYield[+O, +E] extends AnyRef

    The result type returned by StaticStage.process.

    The result type returned by StaticStage.process.

    StaticYield mirrors h8io.stages.Yield but omits the Evolution field, since StaticStage always uses this as the continuation. apply in StaticStage wraps a StaticYield into a full h8io.stages.Yield by supplying the evolution automatically.

    O

    the output type (covariant)

    E

    the error type (covariant)

  19. type UnaryOperator[+S <: Stage[I, _, _], -I, +O, +E] = Alterator[S, I, O, E]

    An Alterator-based unary operator: a stage that wraps a single sub-stage S and potentially changes its input/output/error types.

Value Members

  1. object BaseBinaryOperator
  2. object ConstEvolution extends Serializable
  3. object Fn

    Companion object for Fn.

  4. object Fruitful

    Companion object for Fruitful.

  5. object SAMStage

    Companion object for SAMStage.

  6. object StaticStage

    Companion object for StaticStage.

  7. object StaticYield

    Companion object for StaticYield.

Inherited from AnyRef

Inherited from Any

Ungrouped