0.2.0 • Published 4 years ago

wrapper-types v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Node.js Package Coverage Status

Wrapper-Types

Installation

npm install wrapper-types

Usage

Require the whole module:

const wrappers = require('wrapper-types')

Require types individually:

const { IO, Identity } = require('wrapper-types')

Identity

const { identity } = require('wrapper-types')

const identity = Identity.of(2)

Methods: map, chain, ap, extend, extract, equals, of, is, toString

IO

const { IO } = require('wrapper-types')

const io = IO.of(window)

Methods: map, chain, ap, run, of, is, toString

Maybe

const { Maybe } = require('wrapper-types')

const maybe = Maybe.of(2)

Methods: map, chain, ap, extend, extract, isNothing, of, is, toString

Task

const { Task } = require('wrapper-types')

const task = Task((rej, res) => doAsync().then(res).catch(rej))

Methods: map, chain, ap, fork, of, is, toString

Contributing

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.

License

MIT