h8io.stages.cats

Members list

Type members

Classlikes

final case class IOr[-I, +LO, +RO, +E](left: Stage[I, LO, E], right: Stage[I, RO, E]) extends BinaryOperator[Stage[I, LO, E], Stage[I, RO, E], I, Ior[LO, RO], E]

A binary operator that applies two stages independently to the same input and combines their outputs into a cats.data.Ior (inclusive-or).

A binary operator that applies two stages independently to the same input and combines their outputs into a cats.data.Ior (inclusive-or).

All four combinations of left/right presence are handled:

Left result Right result Output
Yield.Some Yield.Some Ior.Both(l, r)
Yield.Some Yield.None Ior.Left(l)
Yield.None Yield.Some Ior.Right(r)
Yield.None Yield.None Yield.None

Unlike h8io.stages.operators.And (which skips right when left yields no output) and h8io.stages.operators.Or (which skips right when left yields one), IOr always applies both stages, making it the inclusive variant.

Statuses from both stages are merged with combine. The evolution pairs corresponding branches symmetrically (like h8io.stages.operators.IAnd).

Type parameters

E

the error type (covariant)

I

the shared input type (contravariant)

LO

the left output type (covariant)

RO

the right output type (covariant)

Value parameters

left

the stage producing the left side of the Ior

right

the stage producing the right side of the Ior

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait BinaryOperator[Stage[I, LO, E], Stage[I, RO, E], I, Ior[LO, RO], E]
trait Stage[I, Ior[LO, RO], E]
trait I => Yield[I, Ior[LO, RO], E]
class Object
trait Matchable
class Any
Show all
object IOr

Companion object for IOr, containing the private evolution and projections.

Companion object for IOr, containing the private evolution and projections.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
IOr.type

Cats typeclass instances for h8io.stages.Status.

Cats typeclass instances for h8io.stages.Status.

Status forms a cats.Monoid with h8io.stages.Status.Success as the identity element and h8io.stages.Status.combine as the binary operation.

Import StatusInstances.* to bring the instances into scope:

import h8io.stages.cats.StatusInstances.*

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Validated

Stage projections for cats.data.Validated.

Stage projections for cats.data.Validated.

cats.data.Validated[L, R] is a right-biased validation type where Invalid(l) holds an error value and Valid(r) holds a success value. The two projections here allow a pipeline to route values based on which side is present, producing h8io.stages.Yield.Some for the expected side and h8io.stages.Yield.None otherwise. In both cases the status is h8io.stages.Status.Success.

Example:

import h8io.stages.cats.Validated

val validStage   = Validated.Valid[String]    // Stage[cats.data.Validated[Any, String], String, Nothing]
val invalidStage = Validated.Invalid[String]  // Stage[cats.data.Validated[String, Any], String, Nothing]

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Validated.type