Nice! Once you read the explanation, the explicit types make this more understandable and usable than the more usual definition. It seems no more difficult than constructing a Promise from a callback in JavaScript.
(It's still pretty opaque without reading the explanation, though.)
(It's still pretty opaque without reading the explanation, though.)