Packages

final case class Scan[T, +E](op: Stage[(T, T), T, E]) extends Endo[T, E] with Product with Serializable

An endomorphic stage that folds its own inputs into a running accumulator across pipeline runs, via the binary operation stage op — the running-total counterpart of h8io.stages.cycles.Reduce and h8io.stages.cycles.Fold.

Unlike the h8io.stages.cycles family, Scan has no inner stage and no cycle: it consumes one external input per outer run and threads its own accumulator from one run to the next. The first input becomes the accumulator unchanged, without invoking op (the classic seedless reduce, seeded from the pipeline's own input stream instead of a single seed value); each subsequent input is folded via op((accumulator, input)) and the result — the new running total — is emitted immediately, ready for the next run.

When op is applied but itself yields no output — e.g. it filters some inputs out — the accumulator is left unchanged rather than discarded, exactly as in Reduce/Fold, and Scan itself yields nothing for that run.

Since Scan has no separate alterand, the status of a run is simply the status op produced (or Success, for the seeding run in which op is skipped) — there is nothing else to combine it with. Whenever that status is h8io.stages.Status.Complete, the next generation resets to a fresh, unseeded Scan instead of continuing to accumulate — mirroring how h8io.stages.std.Countdown resets on any non-Success status: Complete marks one logical unit of work as finished, and the next external input starts a new one, seeding from scratch.

T

the accumulator and input type (invariant: threaded through as both input and output of op)

E

the error type (covariant)

op

the binary operation stage folding the accumulator and a new input into the next accumulator

Linear Supertypes
Serializable, Serializable, Product, Equals, Stage[T, T, E], (T) ⇒ Yield[T, T, E], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Scan
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Stage
  7. Function1
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Scan(op: Stage[(T, T), T, E])

    op

    the binary operation stage folding the accumulator and a new input into the next accumulator

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (Yield[T, T, E]) ⇒ A): (T) ⇒ A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. def apply(in: T): Yield[T, T, E]

    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.

    Definition Classes
    Scan → Stage → Function1
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  8. def compose[A](g: (A) ⇒ T): (A) ⇒ Yield[T, T, E]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  15. val op: Stage[(T, T), T, E]
  16. def skip(): Evolution[T, T, E]

    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.

    Definition Classes
    Scan → Stage
  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def ~>[_O, _E >: E](that: Stage[T, _O, _E]): Stage[T, _O, _E]

    Composes this stage with that, feeding this stage's output into it.

    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.

    Definition Classes
    Stage
    Annotations
    @inline()

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Stage[T, T, E]

Inherited from (T) ⇒ Yield[T, T, E]

Inherited from AnyRef

Inherited from Any

Ungrouped