IO<A> class
final
IO<A>
represents a non-deterministic synchronous computation that
can cause side effects, yields a value of type A
and never fails.
If you want to represent a synchronous computation that may fail, see IOEither.
- Inheritance
- Mixed-in types
-
- Functor<
_IOHKT, A> - Applicative<
_IOHKT, A> - Monad<
_IOHKT, A>
- Functor<
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
andThen<
B> (covariant IO< B> then()) → IO<B> -
Chain the result of
then
to this IO.override -
ap<
B> (covariant IO< B Function(A a)> a) → IO<B> -
Apply the function contained inside
a
to change the value of typeA
to a value of typeB
.override -
call<
B> (covariant IO< B> chain) → IO<B> -
Chain multiple IO functions.
override
-
chainFirst<
B> (covariant Monad< _IOHKT, B> chain(A a)) → HKT<_IOHKT, A> -
inherited
-
flatMap<
B> (covariant IO< B> f(A a)) → IO<B> -
Used to chain multiple functions that return a IO.
override
-
flatMapTask<
B> (Task< B> f(A a)) → Task<B> - Chain a Task with an IO.
-
map<
B> (B f(A a)) → IO< B> -
Change the value of type
A
to a value of typeB
using functionf
.override -
map2<
C, D> (covariant IO< C> mc, D f(A a, C c)) → IO<D> -
Change type of this IO based on its value of type
A
and the value of typeC
of another IO.override -
map3<
C, D, E> (covariant IO< C> mc, covariant IO<D> md, E f(A a, C c, D d)) → IO<E> -
Change type of this IO based on its value of type
A
, the value of typeC
of a second IO, and the value of typeD
of a third IO.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pure<
B> (B b) → IO< B> -
Return an IO that returns the value
b
.override -
run(
) → A - Execute the IO function.
-
toIOEither<
L> () → IOEither< L, A> - Convert this IO to a IOEither.
-
toIOOption(
) → IOOption< A> - Convert this IO to a IOOption.
-
toString(
) → String -
A string representation of this object.
inherited
-
toTask(
) → Task< A> - Lift this IO to a Task.
-
toTaskEither<
L> () → TaskEither< L, A> - Convert this IO to a TaskEither.
-
toTaskOption(
) → TaskOption< A> - Convert this IO to a TaskOption.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
sequenceList<
A> (List< IO< list) → IO<A> >List< A> > -
Convert a
List<IO<A>>
to a singleIO<List<A>>
. -
traverseList<
A, B> (List< A> list, IO<B> f(A a)) → IO<List< B> > -
Map each element in the list to an IO using the function
f
, and collect the result in anIO<List<B>>
. -
traverseListWithIndex<
A, B> (List< A> list, IO<B> f(A a, int i)) → IO<List< B> > -
Map each element in the list to an IO using the function
f
, and collect the result in anIO<List<B>>
.