Unlift

Unlift is a Projection for Option[T], extracting the contained value when present and producing no output when absent. In both cases the status is Status.Success — absence of a value is not treated as an error.

Unlift is a polymorphic singleton. Use Unlift[T] to obtain a typed Projection[Option[T], T].

import h8io.stages.projections.*
val stage = Unlift[Int]
// stage: h8io.stages.base.Projection[Option[Int], Int] = <function1>
stage(Some(7))
// res0: h8io.stages.Yield[Option[Int], Int, Nothing] = Some(
//   out = 7,
//   status = Success,
//   evolution = <function1>
// )
stage(None)
// res1: h8io.stages.Yield[Option[Int], Int, Nothing] = None(
//   status = Success,
//   evolution = <function1>
// )