-
Notifications
You must be signed in to change notification settings - Fork 2
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
ppx: qualify usages of stdlib infix operators #11
Conversation
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.
Much needed PR
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.
for the cases where type is already known — I'd use type specific equality operator — e.g. Stdlib.Int.equal
for int
and so on
By the way not
should also be qualified.
I'm not sure, this will be adding more runtime without a lot of benefits, see example in playground: let foo (a: string) (b: string) = Js.log (a = b)
let foo2 (a: string) (b: string) = Js.log (String.equal a b) produces: function foo(a, b) {
console.log(a === b);
}
function foo2(a, b) {
console.log(Stdlib__String.equal(a, b));
} |
wow, didn't know that, then it's good as it is, thank you! |
Done in d2f8497. |
oh interesting. I think this is because |
@anmonteiro should we fix this? |
I think it's a good idea -- I'll play with it |
CHANGES: - PPX: Qualify usages of infix operators with `Stdlib` ([melange-community/melange-json#11](melange-community/melange-json#11)) - Add `melange-json-native` package ([melange-community/melange-json#12](melange-community/melange-json#12))
CHANGES: - PPX: Qualify usages of infix operators with `Stdlib` ([melange-community/melange-json#11](melange-community/melange-json#11)) - Add `melange-json-native` package ([melange-community/melange-json#12](melange-community/melange-json#12))
No description provided.