Skip to content

OptionIOOps<A>

extensionOptionIOOps<A>onOption<IO<A>>

Operations for sequencing Option of IO values.

Methods

sequence() extension

IO<Option<A>>sequence()

Returns an IO that will return None if this is a None, or the evaluation of the IO lifted into an Option, specifically a Some.

Available on Option<A>, provided by the OptionIOOps<A> extension

Implementation
dart
IO<Option<A>> sequence() => fold(() => IO.pure(none()), (io) => io.map((a) => Some(a)));