Module: data.task

Stability:3 - Stable
Bug Tracker:
npm package:data.task

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


Require the data.task package, after installing it:

var Task = require('data.task')

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


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


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

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

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

A structure for time-dependent values.