task library
Classes
-
Task<A>
-
Abstract class
Task
that represents a computation
that may produce a result of type A
in the future.
Functions
-
ap<A, B>(Task<B Function(A)> fTask)
→ Task<B> Function(Task<A> task)
-
Applies the function inside a Task to the value inside another Task.
-
flatMap<A, B>(Task<B> fn(A))
→ Task<B> Function(Task<A> task)
-
Flat-maps over a Task by applying the provided function
fn
to its result.
-
fromTask<A>(Task<A> fa)
→ Task<A>
-
Returns the same task given as argument.
-
map<A, B>(B fn(A))
→ Task<B> Function(Task<A> task)
-
Maps over a Task by applying the provided function
fn
to its result.
-
of<B>(B value)
→ Task<B>
-
Constructs a task that resolves to a given value.
-
tap<A>(void f(A))
→ TapFunction<A>
-
Transforms a task into another task after performing a side effect.
Typedefs
-
TapFunction<A>
= Task<A> Function(Task<A> task)
-
Type definition for a function that transforms a task into another task
after performing a side effect.