fantasy-promises
Fantasy Land compatible monadic promises
Last updated 13 years ago by puffnfresh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fantasy-promises 
SYNC missed versions from official npm registry.

Fantasy Promises

This library implements purely functional, monadic promises.

Promise(fork)

Promise is a constructor which takes a fork function. The fork function takes one argument:

fork(resolve)

The resolve callback gets called on a value.

Promise.of(x)

Creates a Promise that contains a successful value.

chain(f)

Returns a new promise that evaluates f when the current promise is successfully fulfilled. f must return a new promise.

map(f)

Returns a new promise that evaluates f on a value and passes it through to the resolve function.

extract()

Executes a promise to get a value.

extend(f)

Returns a new promise that evaluates f over the promise to get a value.

Fantasy Land Compatible

Current Tags

  • 0.1.0                                ...           latest (13 years ago)

2 Versions

  • 0.1.0                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |