fantasy land updates

This commit is contained in:
Leo Horie 2016-10-26 12:55:17 -04:00
parent 4b40d2d3b5
commit 5eb008720a
3 changed files with 134 additions and 87 deletions

View file

@ -16,7 +16,7 @@ module.exports = function(log) {
function initStream(stream) {
stream.constructor = createStream
stream._state = {id: guid++, value: undefined, error: undefined, state: 0, derive: undefined, recover: undefined, deps: {}, parents: [], errorStream: undefined, endStream: undefined}
stream.map = map, stream.ap = ap, stream.of = createStream
stream["fantasy-land/map"] = map, stream["fantasy-land/ap"] = ap, stream["fantasy-land/of"] = createStream
stream.valueOf = valueOf, stream.toJSON = toJSON, stream.toString = valueOf
stream.run = run, stream.catch = doCatch
@ -195,6 +195,7 @@ module.exports = function(log) {
return streams.map(function(s) {return s()})
}, streams)
}
createStream["fantasy-land/of"] = createStream
createStream.merge = merge
createStream.combine = combine
createStream.reject = reject