npm install wrapper-types
Require the whole module:
const wrappers = require('wrapper-types')
Require types individually:
const { IO, Identity } = require('wrapper-types')
const { identity } = require('wrapper-types')
const identity = Identity.of(2)
Methods: map, chain, ap, extend, extract, equals, of, is, toString
const { IO } = require('wrapper-types')
const io = IO.of(window)
Methods: map, chain, ap, run, of, is, toString
const { Maybe } = require('wrapper-types')
const maybe = Maybe.of(2)
Methods: map, chain, ap, extend, extract, isNothing, of, is, toString
const { Task } = require('wrapper-types')
const task = Task((rej, res) => doAsync().then(res).catch(rej))
Methods: map, chain, ap, fork, of, is, toString
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.