Task¶data.task.Task¶type Task(α, β)
new ((α → Unit), (β → Unit) → γ), (γ → Unit)
implements
Chain(β), Monad(β), Functor(β), Applicative(β),
Semigroup(β), Monoid(β), ToString
A structure for time-dependent values.
Task.of(value)¶β → Task(α, β)
Constructs a new Task containing the given successful value.
Task.prototype.map(transformation)¶@Task(α, β) => (β → γ) → Task(α, γ)
Transforms the successful value of the Task using a regular unary function.
Task.prototype.chain(transformation)¶@Task(α, β) => (β → Task(α, γ)) → Task(α, γ)
Transforms the succesful value of the Task using a function over monads.
Task.prototype.ap(task)¶@Task(α, β → γ) => Task(α, β) → Task(α, γ)
Transforms a Task by applying the function inside this receiver.
Task.prototype.orElse(transformation)¶@Task(α, β) => (α → Task(γ, β)) → Task(γ, β)
Transforms the failure value of the Task into a new Task.
Task.prototype.fold(onRejection, onSucecss)¶@Task(α, β) => (α → γ), (β → γ) → Task(δ, γ)
Applies a function to each side of the task.
Task.prototype.cata(pattern)¶@Task(α, β) => { Rejected: α → γ, Resolved: β → γ } → Task(δ, γ)
Applies a function to each side of the task.