Comment Comment by finnyspade Wouldn't it be (with a little runtime typechecking):function IdentityMonad(v) { this._v = v; }IdentityMonad.prototype.bind = function(f) { var o = f(this._v); if(!(o instanceof IdentityMonad)){ throw new Error("function must return IdentityMonad"); } return o; } parent finnyspade 10 years ago
function IdentityMonad(v) {
}IdentityMonad.prototype.bind = function(f) {