4 ms·
This kind of reminds me of the story of promises in javascript, which are almost but not quite monads. Among other things, this has made implementing cancellati
by lenticular 8y ago
This kind of reminds me of the story of promises in javascript, which are almost but not quite monads. Among other things, this has made implementing cancellation difficult. In addition, if it were monadic, the async/await syntax could have been trivially generalized to arbitrary monads. That would have been nice.
- BreakfastB0b 8y agoYou can get async / await for arbitrary monads in JavaScript using generator functions and coroutines.
- michaelsbradley 8y agoAlso, IxJS and RxJS provide some really nice sugar for working with higher-level abstractions around "pull" and "push" flows. The protocols associated with `Symbol.Observable` and `Symbol.asyncIterator` have small surface areas, so it's not difficult to hand-write implementations (using generators and async generators) to adapt code that wouldn't otherwise fit in the flow.
- lenticular 8y agoThanks for the tip!