-
Notifications
You must be signed in to change notification settings - Fork 470
Optimizations lost in uncurried mode #6879
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
Comments
Related example: When Belt is compiled in uncurried mode, the following code open RescriptSchema
let stringSet = S.array(S.string)->S.transform(_ => {
parser: a => Belt.Set.String.fromArray(a),
serializer: a => Belt.Set.String.toArray(a),
}) compiles to let stringSet = S$RescriptSchema.transform(S$RescriptSchema.array(S$RescriptSchema.string), (function (param) {
return {
p: (function (a) {
return Belt_SetString.fromArray(a);
}),
s: (function (a) {
return Belt_SetString.toArray(a);
})
};
})); whereas when Belt is compiled in curried mode, it compiles to let stringSet = S$RescriptSchema.transform(S$RescriptSchema.array(S$RescriptSchema.string), (function (param) {
return {
p: Belt_SetString.fromArray,
s: Belt_SetString.toArray
};
})); |
It's probably worth investigating what transformations can be gradually removed so |
It seems that |
Instead, here's the effect of removing |
This then blindly changes every application at the lambda level to use |
Everything resolved in current master. |
Uh oh!
There was an error while loading. Please reload this page.
jscomp/gentype_tests/typescript-react-example/src/Records.res
This is a follow-up to my comments on the diffs in #6864.
Inlining lost in the output for
jscomp/gentype_tests/typescript-react-example/src/Records.res
:Before (curried mode):
After (uncurried mode):
Temporary variable introduced in
jscomp/test/bs_poly_mutable_set_test.res
:Input:
Before (curried mode):
After (uncurried mode):
(OTOH isEmpty is now inlined here which is good.)
The text was updated successfully, but these errors were encountered: