(Anonymous)

The container for instance methods for the Task structure.

This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Documentation

The container for instance methods for the Task structure.

Properties

Combining tasks

and: value(that)

Constructs a new task that awaits both tasks to resolve. The result of the new task is a tuple containing the results of the left and right tasks, if they all succeed, or the first failure if they fail.

Experimental
or: value(that)

Combines two tasks such that the resulting task assimilates the result of the first one to resolve.

Experimental

Executing tasks

run: value()

Executes a Task and returns a TaskExecution object representing the execution.

Experimental

Fantasy Land

ap(that)

Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

fantasy-land/ap(that)

Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

fantasy-land/bimap(f, g)

Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

fantasy-land/chain(transformation)

Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

fantasy-land/map(transformation)

Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

Pattern matching

willMatchWith: value(pattern)

Chooses and executes a function for each variant in a Task. The function must return a new task, whose value and state will be assimilated.

Experimental

Recovering from errors

orElse: value(handler)

Transforms a failed task's value and state.

Experimental
swap: value()

Inverts the state of a Task. That is, turns successful tasks into failed ones, and failed tasks into successful ones.

Experimental

Transforming tasks

apply: value(task)

Applies the function in the left task to the value on the right task. The left task is ran to completion before the right task is started.

Experimental
bimap: value(rejectionTransformation, successTransformation)

Transforms the rejected or resolved values of a Task with a function. The state of the task is not changed.

Experimental
chain: value(transformation)

Transforms the value and state of a Task.

Experimental
map: value(transformation)

Transforms the value of a successful task.

Experimental
mapRejected: value(transformation)

Transforms the value of a failed task.

Experimental

Types

constructor: Task(computation)

Tasks model asynchronous processes with automatic resource handling. They are generally constructed with the task function.

Experimental
Stability
experimental
Authors
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)