Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

fantasy-do

1.1.0 • Public • Published

fantasy-do

NPM version Build status Dependencies

What is it? Take your pick:

  • do notation for fantasy-land javascript.
  • co for monads.
  • async/await for chainables.

It allows you take take this code:

const div = (=== 0) ? Nothing() : Just(/ b)
const result = div(8, 2)
  .map(a => a + 2)
  .chain(b => div(b, 2))
}

And write it like this:

const mdo = require('fantasy-do')
const result = mdo(function * () {
  const a = yield div(8, 2)
  b = a + 2
  return div(b, 2)
})

install

npm i fantasy-do

Downloadsweekly downloads

2

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability