
Akh - noun
1) Large flightless bird found in Fantasy Land
2) Javascript monad transformer library
$ npm install --save akh
Overview
Akh is a collection of monad and monad transformers that implement Fantasy Land's interfaces. It is inspired by Haskell's MTL.

Usage
Akh can either be used as a single library, or you can pick up individual types from split out libraries. See each library for more documentation on that type.
All functions from akh.core are top level exports.
Monad Transformers
- akh.ContT - Continuation transformer. (Monad, Functor, Applicative Functor)
- akh.DContT - Delimited continuation transformer. (Monad, Functor, Applicative Functor)
- akh.EitherT - Either transformer. (Monad, Monoid, Functor, Applicative Functor)
- akh.ErrorT - Error transformer. (Monad, Monoid, Functor, Applicative Functor)
- akh.IdentityT - Transforms a monad to itself. (Monad, Functor, Applicative Functor)
- akh.ListT - List transformer. (Monad, Monoid, Functor, Applicative Functor)
- akh.MaybeT - Maybe transformer. (Monad, Monoid, Functor, Applicative Functor)
- akh.ReaderT - Reader transformer. (Monad, Monoid, Functor, Applicative Functor)
- akh.StateT - State transformer. (Monad, Monoid, Functor, Applicative Functor)
- akh.UniqueT - Get unique int value (Monad, Monoid, Functor, Applicative Functor)
- akh.WriterT - Writer transformer. (Monad, Monoid, Functor, Applicative Functor)
Monads
- akh.Cont - Continuation computation. (Monad, Functor, Applicative Functor)
- akh.DCont - Delimited continuation computation. (Monad, Functor, Applicative Functor)
- akh.Either - Either computation. (Monad, Functor, Applicative Functor)
- akh.Error - Error computation. (Monad, Functor, Applicative Functor)
- akh.Identity - Identity computation. (Monad, Functor, Applicative Functor)
- akh.List - List computation. (Monad, Monoid, Functor, Applicative Functor)
- akh.Maybe - Computation that may produce a value or nothing. (Monad, Monoid, Functor, Applicative Functor)
- akh.Reader - Reader monad. (Monad, Monoid, Functor, Applicative Functor)
- akh.State – Stateful computation. (Monad, Functor, Applicative Functor)
- akh.Unique – Get Unique int (Monad, Monoid, Functor, Applicative Functor)
- akh.Writer - Writer monad. (Monad, Monoid, Functor, Applicative Functor)
Quick Example
const List = Listconst StateT = StateT // Define a new monad using the state transformer on the list monad.const M = // Define a way to pass values through `M`const run = List // Create a simple stateful computation with an initial valueconst start = M // Run the stateful computation to get a list of// value, state pairs === value: 'porky' state: 'wackyland' // Let's update the current state using a functionconst modifiedState = start === value: 'WACKYLAND' state: 'WACKYLAND' // Note that modify also updated the held value here. We could avoid that// by instead writingconst modifiedState2 = start === value: 'porky' state: 'WACKYLAND' // Now let's start using the list monad and branch the state.const branched = modifiedState2 === value: 'porky' state: 'WACKYLAND' value: 100 state: 'nuts' value: 1 state: 'squirrel' value: 'wackyland' state: 'wackyland' // We can then operate on all states at the same time.const doubled = branched === value: 'porkyporky' state: 'WACKYLAND' value: 200 state: 'nuts' value: 2 state: 'squirrel' value: 'wackylandwackyland' state: 'wackyland'
Contribute
Improvement and additions to Akh are welcome. Please report any issues or send a pull request.
The Dodo Bird is a Looney Toons character created and owned by Warner Bros.