Skip to content

Conversation

@riaqn
Copy link
Contributor

@riaqn riaqn commented Mar 27, 2025

Based on #3757 and #3758 and #3824

This PR adds the support for modules of non-legacy modes. Functor parameter and body are still fixed to be legacy.

TODO:

  • Improve inclusion error messages
  • Add tests reflecting subtle code changes in type checking
  • Add tests showing functor application mode error message

The room for improvement shouldn't block preliminary review and discussion. In particular, changes to the existing tests seem correct, and can serve as a good starting point.

@riaqn riaqn requested a review from lukemaurer March 27, 2025 17:24
@riaqn riaqn added typing modes Work on modes. There's some overlap with the `multicore` label, but not strictly so. labels Mar 27, 2025
@riaqn riaqn force-pushed the modal-module branch 4 times, most recently from eefebc5 to 2f89dc6 Compare April 4, 2025 16:59
@riaqn riaqn changed the base branch from main to minor-fix-modes April 8, 2025 13:43
Copy link
Collaborator

@goldfirere goldfirere left a comment

Choose a reason for hiding this comment

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

Took a quick look at the tests, just to understand the design better. Looks good to me, just a few comments as I was scrolling through.

Copy link
Contributor

@lukemaurer lukemaurer left a comment

Choose a reason for hiding this comment

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

Still not entirely reviewed but just have env.ml and env.mli left.

@riaqn riaqn force-pushed the minor-fix-modes branch 2 times, most recently from 7ac004d to b89cf95 Compare May 26, 2025 10:14
Base automatically changed from minor-fix-modes to main June 3, 2025 17:23
@goldfirere
Copy link
Collaborator

I've resolved my Discussions on this PR

Copy link
Contributor

@lukemaurer lukemaurer left a comment

Choose a reason for hiding this comment

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

Looks good, other than I think it should say “escapes its region” rather than “escapes region”

@riaqn riaqn force-pushed the modal-module branch 2 times, most recently from 6a6f258 to 3030775 Compare June 17, 2025 14:37
@riaqn riaqn force-pushed the modal-module branch 2 times, most recently from e24a7fe to 9af2554 Compare June 25, 2025 13:20
@riaqn
Copy link
Contributor Author

riaqn commented Jun 27, 2025

@lukemaurer can you review the new commits:

post rebase fix

include should rebase modalities

change how extension level affects modalities

improve comments

change error message

Copy link
Contributor

@lukemaurer lukemaurer left a comment

Choose a reason for hiding this comment

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

All good, up to a few comment tweaks

@riaqn
Copy link
Contributor Author

riaqn commented Jul 9, 2025

For backward compatibility, this PR has the following catches:

  • The semantics of user-written signatures (default modalities, modalities on include and on module) stay the exact same.
  • That also means functor declaration will continue to be nonportable, even though our type checker is now capable of infering it to be portable.

This will be addressed in a future PR (probably under mode_alpha).

@riaqn riaqn enabled auto-merge (squash) July 9, 2025 15:22
This reverts commit 691cf52.
@riaqn riaqn merged commit 798cbb2 into main Jul 9, 2025
23 checks passed
@riaqn riaqn deleted the modal-module branch July 9, 2025 15:50
@riaqn
Copy link
Contributor Author

riaqn commented Jul 9, 2025

Catch-up review for @lukemaurer
b46c23c
a7d4d54
And please review the following two commits combined: (this is related to #3578 but doesn't affect performance)
722efb0
be7a018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modes Work on modes. There's some overlap with the `multicore` label, but not strictly so. typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants