Akh Identity Monad
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
trans
type
.editorconfig
.gitignore
CHANGELOG.md
LICENSE
README.md
index.js
package.json

README.md

Identity Monad and Monad Transformer for Akh Javascript Monad Library

The identity transformer, IdentityT, transforms a monad to itself. The base type, Identity, wraps a simple value.

# To use as standalone package
$ npm install --save akh.identity

# To use as part of akh library
$ npm install --save akh

Usage

The Identity and IdentityT implement the Fantasy Land monad, functor, and applicative functor interfaces.

Fantasy Land logo
// Identity monad
require('akh.identity').Identity
require('akh').Identity

// Identity monad transformer
require('akh.identity').IdentityT
require('akh').IdentityT

Identity.run(m), m.run()

Extract a value from an identity monad.

IdentityT.run(t), t.run()

Same as Identity.run but for transformed type.

Contributing

Contributions are welcome.

To get started:

$ cd akh-identity
$ npm install # install dev packages
$ npm test # run tests