Skip to content

Instantly share code, notes, and snippets.

@yelouafi yelouafi/stream-map.js
Last active Aug 29, 2015

What would you like to do?
// map : (Stream a, a -> b) -> Stream b = function(f) {
return this.isEmpty || this.isAbort ? this
: this.isCons ? Stream.Cons(f(this.head),
: Stream.Future(
s =>,
err => Stream.Abort(err)))
Stream.seq([1,2,3], 0, 1000).map(x => x+1).log('seq')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.