Module: data.task

Stability:3 - Stable
Bug Tracker:https://github.com/folktale/data.task/issues
Version:3.0.0
Repository:https://github.com/folktale/data.task
Portability:Portable
npm package:data.task

A structure for time-dependent values, providing explicit effects for delayed computations, latency, etc.

Loading

Require the data.task package, after installing it:

var Task = require('data.task')

This gives you back a data.task.Task object.

Why?

This structure allows one to model side-effects (specially time-based ones) explicitly, such that one can have full knowledge of when they’re dealing with delayed computations, latency, or anything that isn’t pure or can be computed immediately.

A common use of this structure is to replace the usual Continuation-Passing Style form of programming in order to be able to compose and sequence time-dependent effects using the generic and powerful monadic operations.

Additional resources

Types and structures

Task

class data.task.Task
type Task(α, β)

new ((α → Unit), (β → Unit) → γ), (γ → Unit)

implements
  Chain(β), Monad(β), Functor(β), Applicative(β),
  Semigroup(β), Monoid(β), ToString

A structure for time-dependent values.