Includes both regular codensity monad Codensity
and codensity monad transformer CodensityT
.
$ npm install --save akh.codensity
$ npm install --save akh
Usage
The codensity monad/transformer implements the Fantasy Land monad and monoid interfaces.
require('akh.codensity').Codensity
require('akh').Codensity
require('akh.codensity').CodensityT
require('akh').CodensityT
Codensity.run(m, k)
, m.run(k)
Perform a codensity computation m
and complete with outer continuation k
.
const Codensity = requre('akh.Codensity').Codensity
var c = Codensity.of(3).map(x => -x)
Codensity.run(c, console.log)
c.run(console.log)
CodensityT.run(m, k)
, m.run(k)
Same as Codensity.run
but for transformed types
Contributing
Contributions are welcome.
To get started:
$ cd akh-codensity
$ npm install
$ npm test