Skip to content

lfaudreejr/wrapper-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A suite of Abstract Data Types

Resources

Stars

Watchers

Forks

Packages

No packages published