MostlyAdequate / mostly-adequate-guide

Mostly adequate guide to FP (in javascript)
Other
23.43k stars 1.87k forks source link

sequence(IO.of, Either.of(IO.of('buckle my shoe'))) example from ch12 always return undefined #589

Closed deleite closed 3 years ago

deleite commented 3 years ago

check the examples I see that this one does not work and always gives me a undefined. I have no idea why but I like to know why this is happening...

any clues?

deleite commented 3 years ago

Sorry, looking at the pull requests I see that there is a fix for that by changing the traverse method in the Right:

traverse(of, fn) { fn(this.$value).map(Either.of); return fn(this.$value).map(Either.of); } }