-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement interfaces (issue #40) #42
Conversation
Just to confirm, these are generated? (It's been a while since I used reason) |
I used editor plugin type hints (which uses bsb), and wrote manually according to those, however I did change the signature of Maybe I should change the signature of |
src/FutureJs.re
Outdated
@@ -26,6 +26,7 @@ let fromPromise = (promise, errorTransformer) => | |||
|> ignore | |||
|> Js.Promise.resolve | |||
) | |||
|> ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this modify the interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it does. Ok I'll change this PR to ensure backwards compatibility
The interface is now carefully implemented to be identical with type inference done by bsb, so this PR should be 100% backwards compatible at this point. Assuming though that the implementation details of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you you create this by using the automatic interface generator? https://bucklescript.github.io/docs/en/automatic-interface-generation |
@briangorman why is the automatic creation of the interface file a concern? Standardization? |
Just making sure that the interface isn't changing |
It would be an extraordinary case where the interface could change. And in the case where it would change it would be that the specified interface is more specific than the inference done by bsb. If there's concern over interface incompatibility we should bump the major version number. However, I don't see anything which is different. |
@briangorman Can we go ahead and merge this? |
@scull7 I haven't had time to check this, but if you have taken a look and the interface didn't change I have no problem merging this 👍 |
As far as I can tell, and the tests can tell, the interface has not changed. |
The PR looks good. Only thing that seems to differ from the build in generator is the parameter order e.g.
versus (generated)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR,
Could you please generate this file by running the bsb inference? The parameter names to functions are ordered differently than those generated by bsb and I think we should try to stay as consistent with community conventions as possible.
e.g.
let map: (t('a), 'a => 'b) => t('b);
versus (generated)
let map: (t('b), 'b => 'a) => t('a);
Running the inference is very quick.
No description provided.