New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nesting a repromise inside a promise is not sound #8
Comments
Indeed, the discussion about that is here: rescript-lang/rescript-compiler#2345 (comment). The TL;DR summary is: fixing and not fixing this issue both have negative implications for interop with JavaScript, and for now my guess is that it is better not to fix it, however it is only a guess, so please give any information to the contrary (or in support) that you come across. More detail:
For now, I think it's better to
And, of course, all of this should be loudly documented as repromise takes shape :) I want to also point out that none of the above is any way "final." Repromise is an exploration project, we will learn and adapt as we go. |
I agree with this sentiment. Just wanted to make it clear that if this is a limitation of repromise, it should be thoroughly documented so that binding authors are aware of the possible pitfalls. |
@ncthbrt There is now some initial documentation about this in Repromise's new doc site. |
Awesome. :) |
This perhaps might not be a use case you want to support, but if so this limitation should be clearly documented. To give a specific example,
Js.Promise.resolve(Repromise.resolve(5))
will collapse.This of course has implications for interop with existing javascript libraries. A function which has signature
'a => Js.Promise.t('a)
can not be soundly typed should'a
be of typeRepromise.t('b)
.This fork of vow is able to solve this case: http://github.com/ncthbrt/vow but is not without the additional overhead of an extra wrapper.
The text was updated successfully, but these errors were encountered: