Skip to content
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

Cleanup uncurried #6080

Merged
merged 7 commits into from
Mar 17, 2023
Merged

Cleanup uncurried #6080

merged 7 commits into from
Mar 17, 2023

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Mar 16, 2023

Use just @@uncurried for what used to be called uncurried-always. (Just keep @@uncurried.swap for syntax swap tests, but it's not planned to be user-facing). Also removed @@toUncurried.
Simplify project setting to just a boolean: "uncurried": true.

@cristianoc cristianoc requested a review from cknitt March 16, 2023 19:32
@@ -24,10 +24,10 @@ subset of the arguments, and return a curried type with the remaining ones https
- Add support for default arguments in uncurried functions https://github.com/rescript-lang/rescript-compiler/pull/5835
- Inline uncurried application when it is safe https://github.com/rescript-lang/rescript-compiler/pull/5847
- Support optional named arguments without a final unit in uncurried functions https://github.com/rescript-lang/rescript-compiler/pull/5907
- Add support for uncurried-always: a mode where everything is considered uncurried, whether with or without the `.`. This can be turned on with `@@uncurriedAlways` locally in a file. Added a project config `"uncurried"`, which propagates to dependencies, and takes the values: `"legacy"` which changes nothing, or `"default"` for uncurried by default, or `"always"` for uncurried-always.
- Add support for uncurried mode: a mode where everything is considered uncurried, whether with or without the `.`. This can be turned on with `@@uncurried` locally in a file. For project-level configuration in `bsconfig.json`, there's a boolean config `"uncurried"`, which propagates to dependencies, to turn on uncurried mode.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move this to the top of the list so that people read about this first, not about the "uncurried by default" mode.

Shouldn't the uncurried mode be labeled "experimental" for now, too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog will need to be turned around to be in a simple consumable form.
For now, just logging what changes have been made, in case some bugs come up.

Base automatically changed from pervasivesU to master March 17, 2023 06:45
Rename `@@uncurried` to `@@uncurried.swap` so relegating it to tests only.
Also simplify the setting in bsconfig, which now takes just a boolean.
The Config module is used by the compiler, so the `uncurried` setting needs to be reset on each file as tests compile several files on a single command line (actual project builds don't).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants