Lift

Lift wraps the inner stage's optional output into an Option, making the result always present.

Because Lift always emits a value, it extends Fruitful. The evolution is mapped so that every continuation stage remains wrapped in Lift. Lift is the inverse of Unlift.

import h8io.stages.operators.*
import h8io.stages.projections.*
val lifted = Lift(Unlift[Int])
// lifted: Lift[Option[Int], Int, Nothing] = Lift(alterand = <function1>)
lifted(Some(7))
// res0: h8io.stages.Yield.Some[Option[Int], Option[Int], Nothing] = Some(
//   out = Some(value = 7),
//   status = Success,
//   evolution = Mapped(
//     evolution = <function1>,
//     f = h8io.stages.operators.Lift$$Lambda$14357/0x00007f2c9263b590@155f68c5
//   )
// )
lifted(None)
// res1: h8io.stages.Yield.Some[Option[Int], Option[Int], Nothing] = Some(
//   out = None,
//   status = Success,
//   evolution = Mapped(
//     evolution = <function1>,
//     f = h8io.stages.operators.Lift$$Lambda$14358/0x00007f2c9263b958@449ef534
//   )
// )