Skip to content

OptionIOOps<A>

extension OptionIOOps<A> on Option<IO<A>>

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)));