|
|
|
|
|
by dasyatidprime
1822 days ago
|
|
So, just out of curiosity: I know in ECMAScript this is probably mainly for the purpose of giving you a convenient way to lift either (α → β) or (α → Promise β) into (Promise α → Promise β) without static typing or having two "then" functions, by forcing β and Promise β to be disjoint. It also allows looser composition underneath, since you can choose which kind of return to provide at runtime without having to re-wrap the bare case manually. But are there any other reasons for Promise of Promise to be squashed away like that? |
|
There's a bunch of history in [1], particularly [2] and [3], if you care to read them.
[1]: https://github.com/promises-aplus/promises-spec/issues
[2]: https://github.com/promises-aplus/promises-spec/issues/75
[3]: https://github.com/promises-aplus/promises-spec/issues/94