Comparing version 0.3.0 to 0.4.0
@@ -16,6 +16,8 @@ /* | ||
})(Identity.runIdentity, (function(m, k) { | ||
return runContT(m, (function(x) { | ||
return new(Identity)(k(x)); | ||
})); | ||
return runContT(m, (function(f, g) { | ||
return (function(x) { | ||
return f(g(x)); | ||
}); | ||
})(Identity.of, k)); | ||
}))); | ||
(module.exports = Cont); |
/* | ||
* THIS FILE IS AUTO GENERATED from 'lib/identity.kep' | ||
* THIS FILE IS AUTO GENERATED FROM 'lib/identity.kep' | ||
* DO NOT EDIT | ||
*/"use strict"; | ||
*/ | ||
"use strict"; | ||
var __o = require("./structure"), | ||
@@ -6,0 +7,0 @@ Functor = __o["Functor"], |
/* | ||
* THIS FILE IS AUTO GENERATED FROM 'lib/list.kep' | ||
* THIS FILE IS AUTO GENERATED from 'lib/list.kep' | ||
* DO NOT EDIT | ||
*/ | ||
"use strict"; | ||
*/"use strict"; | ||
var Identity = require("./identity"), | ||
@@ -7,0 +6,0 @@ ListT = require("./trans/list"), |
/* | ||
* THIS FILE IS AUTO GENERATED FROM 'lib/trans/dcont.kep' | ||
* THIS FILE IS AUTO GENERATED from 'lib/trans/dcont.kep' | ||
* DO NOT EDIT | ||
*/ | ||
"use strict"; | ||
*/"use strict"; | ||
var stream = require("nu-stream")["stream"], | ||
@@ -18,16 +17,6 @@ first = stream["first"], | ||
}), | ||
FSeg = (function(f) { | ||
P = (function(t) { | ||
var self = this; | ||
(self.frame = f); | ||
}); | ||
(FSeg.prototype = new(Seg)()); | ||
var MSeg = (function(f) { | ||
var self = this; | ||
(self.frame = f); | ||
}); | ||
(MSeg.prototype = new(Seg)()); | ||
var P = (function(t) { | ||
var self = this; | ||
(self.prompt = t); | ||
}), | ||
(self.prompt = t); | ||
}), | ||
empty = stream.NIL, | ||
@@ -39,8 +28,5 @@ push = stream.cons, | ||
}), | ||
pushFSeg = (function(f, k) { | ||
return push(new(FSeg)(f), k); | ||
pushSeg = (function(f, k) { | ||
return push(new(Seg)(f), k); | ||
}), | ||
pushMSeg = (function(f, k) { | ||
return push(new(MSeg)(f), k); | ||
}), | ||
splitSeq = (function(t, k) { | ||
@@ -51,4 +37,6 @@ if (isEmpty(k)) return [empty, empty]; | ||
if (((x instanceof P) && (x.prompt === t))) return [empty, xs]; | ||
var sub = splitSeq(t, xs); | ||
return [push(x, sub[0]), sub[1]]; | ||
var __o = splitSeq(t, xs), | ||
a = __o[0], | ||
b = __o[1]; | ||
return [push(x, a), b]; | ||
}), | ||
@@ -66,5 +54,4 @@ unDContT = (function(m, k) { | ||
var top = first(c); | ||
if ((top instanceof MSeg)) return unDContT(top.frame(x), rest(c)); | ||
else if ((top instanceof FSeg)) return appk(rest(c), top.frame(x)); | ||
else(c = ((top instanceof P) ? rest(c) : top)); | ||
if ((top instanceof Seg)) return unDContT(top.frame(x), rest(c)); | ||
(c = ((top instanceof P) ? rest(c) : top)); | ||
} | ||
@@ -90,3 +77,3 @@ while (true); | ||
return new(Instance)((function(k) { | ||
return unDContT(c, pushMSeg(f, k)); | ||
return unDContT(c, pushSeg(f, k)); | ||
})); | ||
@@ -109,4 +96,6 @@ })); | ||
return new(Instance)((function(k) { | ||
var sub = splitSeq(prompt, k); | ||
return unDContT(f(sub[0]), sub[1]); | ||
var __o = splitSeq(prompt, k), | ||
x = __o[0], | ||
xs = __o[1]; | ||
return unDContT(f(x), xs); | ||
})); | ||
@@ -125,5 +114,6 @@ }))); | ||
(Instance.shift = (Instance.prototype.shift = (function(p, f) { | ||
return Instance.withSubCont(p, (function(k) { | ||
return Instance.pushPrompt(p, f((function(c) { | ||
return Instance.pushPrompt(p, Instance.pushSubCont(k, c)); | ||
var t = this; | ||
return t.withSubCont(p, (function(k) { | ||
return t.pushPrompt(p, f((function(c) { | ||
return t.pushPrompt(p, t.pushSubCont(k, c)); | ||
}))); | ||
@@ -130,0 +120,0 @@ })); |
/* | ||
* THIS FILE IS AUTO GENERATED FROM 'lib/trans/list.kep' | ||
* THIS FILE IS AUTO GENERATED from 'lib/trans/list.kep' | ||
* DO NOT EDIT | ||
*/ | ||
"use strict"; | ||
*/"use strict"; | ||
var __o = require("../base"), | ||
@@ -7,0 +6,0 @@ liftM = __o["liftM"], |
{ | ||
"name": "akh", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Monad and Monad Transformer Collection", | ||
@@ -23,5 +23,6 @@ "author": "Matt Bierner", | ||
"files": [ | ||
"bin/", | ||
"dist_node", | ||
"index.js" | ||
"index.js", | ||
"test.js", | ||
"tests" | ||
], | ||
@@ -38,3 +39,3 @@ | ||
"khepri": ">=0.19.0" | ||
"khepri": ">=0.20.0" | ||
}, | ||
@@ -41,0 +42,0 @@ |
@@ -19,2 +19,4 @@ # Akh | ||
* DContT - `akh::trans::dcont` - Delimited continuation transformer. (Monad, Functor, Applicative Functor) | ||
* EitherT - `akh::trans::either` - Either transformer. (Monad, Monoid, Functor, Applicative Functor) | ||
* ErrorT - `akh::trans::error` - Error transformer. (Monad, Monoid, Functor, Applicative Functor) | ||
@@ -27,4 +29,7 @@ ### Monads | ||
* DCont - `akh::dcont` - Delimited continuation computation. (Monad, Functor, Applicative Functor) | ||
* EitherT - `akh::either` - Either computation. (Monad, Functor, Applicative Functor) | ||
* ErrorT - `akh::error` - Error computation. (Monad, Functor, Applicative Functor) | ||
## Contribute | ||
@@ -31,0 +36,0 @@ Improvement and additions to Akh are welcome. Please report any [issues][issues] |
38146
27
1278
57