-
Notifications
You must be signed in to change notification settings - Fork 77
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
Unboxed records #3229
Merged
Merged
Unboxed records #3229
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parser Change ChecklistThis PR modifies the parser. Please check that the following tests are updated:
This test should have examples of every new bit of syntax you are adding. Feel free to just check the box if your PR does not actually change the syntax (because it is refactoring the parser, say). |
rtjoa
force-pushed
the
rtjoa.basic_unboxed_records
branch
from
November 5, 2024 19:13
7be53ee
to
70be641
Compare
rtjoa
force-pushed
the
rtjoa.basic_unboxed_records
branch
4 times, most recently
from
November 6, 2024 17:04
7ac8450
to
dacc5d7
Compare
rtjoa
force-pushed
the
rtjoa.basic_unboxed_records
branch
from
November 6, 2024 17:22
dacc5d7
to
6f41f22
Compare
rtjoa
force-pushed
the
rtjoa.basic_unboxed_records
branch
16 times, most recently
from
November 11, 2024 16:52
e5e3ea5
to
aeae90b
Compare
rtjoa
force-pushed
the
rtjoa.basic_unboxed_records
branch
from
December 3, 2024 19:02
5031588
to
a75d1fe
Compare
ccasin
reviewed
Dec 4, 2024
ccasin
reviewed
Dec 4, 2024
ccasin
reviewed
Dec 4, 2024
ccasin
reviewed
Dec 4, 2024
- Exhaustive match on type_kind instead of desc - Fix ignored pat printing - Dont compute `_jkinds`
ccasin
reviewed
Dec 5, 2024
ccasin
approved these changes
Dec 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for unboxed records (construction, functional updates, projection, pattern matching), whose types have product jkinds. For example:
The fields of unboxed records have a separate namespace from record fields. While fields can be mutable, we don't yet support updating them.
Implementation decisions
Unboxed record types are distinct from record types, rather than being yet another
record_representation
.label_description
abstract over the type for record representations, which is now eitherrecord_representation
orrecord_unboxed_product_representation
. This allowed nearly all shared logic to be parameterized by the record "form," with the most notable exception being in lambda/matching.ml.A (temporary) jkind-checking algorithm that interleaves looking through unboxed types and type expressions constructors.
type_jkind_deep
in typing/ctype.ml.constrain_type_jkind
to return a jkind estimate, but this would require significant changes. Instead, we use this somewhat duplicative solution, as it will be removable once we support kind-polymorphic type declarations.Future work
t
also declares its unboxed versiont#
, when doing so would be well-founded.type t boxes value & value
declares the kinds of botht
andt#
and indicates that they are linked.Review: @ccasin