Skip to content

ReML type bindings#207

Open
melsman wants to merge 4 commits intomasterfrom
reml-type-bindings
Open

ReML type bindings#207
melsman wants to merge 4 commits intomasterfrom
reml-type-bindings

Conversation

@melsman
Copy link
Owner

@melsman melsman commented Feb 26, 2026

Add support for explicit region and effect abstractions in type bindings.

Copilot AI review requested due to automatic review settings February 26, 2026 22:59
@melsman melsman self-assigned this Feb 26, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds ReML support for explicit region/effect abstractions in type bindings by extending the parser/AST, elaboration, and type-function representations, along with new/updated explicit-region tests.

Changes:

  • Extend the grammar and AST to carry explicit region/effect parameters on type bindings and constructed types.
  • Update elaboration/type-function machinery to track ReML arity (region/effect var counts) and validate regvar usage.
  • Add new explicit-region regression tests and expected outputs.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/explicit_regions/ty1.sml Updates type-binding syntax to include explicit regvar parameter sequences.
test/explicit_regions/expty3.sml New test for region-abstract type declarations and application.
test/explicit_regions/expty3.sml.out.ok Expected output for expty3.sml.
test/explicit_regions/err_ty2.sml New negative test for repeated abstract regvars in type bindings.
test/explicit_regions/err_ty2.sml.log.ok Expected error log for err_ty2.sml.
test/explicit_regions/err_ty3.sml New negative test for free regvar in type binding.
test/explicit_regions/err_ty3.sml.log.ok Expected error log for err_ty3.sml.
test/explicit_regions/err_expty4.sml New negative test ensuring applied region-abstract type functions are tracked.
test/explicit_regions/err_expty4.sml.log.ok Expected error log for err_expty4.sml.
test/explicit_regions/er18.sml.log.ok Updates expected errors due to new regvar-seq validation.
test/explicit_regions/all.tst Registers new tests in the explicit-regions test suite.
test/explicit_regions/Makefile Updates test source list to include new explicit-region tests.
src/Parsing/Topdec.grm Adds parsing support for regvar sequences in type bindings and prefix regvar type application.
src/Parsing/GrammarUtils.sml Updates type traversal/rewriting to carry regvar lists on CONty and TYPBIND.
src/Manager/OpacityElim.sml Adjusts synthetic TYPBIND construction for new regvar-seq payload.
src/Manager/FreeIds.sml Updates free-id traversal to match new TYPBIND/CONty shapes.
src/Compiler/Lambda/CompileDec.sml Updates constraint collection traversal for new CONty shape.
src/Common/TyName.sml Extends TyName with ReML arity tracking and updates pickling.
src/Common/TYNAME.sig Exposes arity_reml and updates freshTyName signature.
src/Common/STATOBJECT.sml Updates TypeFcn API to include regvar parameters and ReML arity.
src/Common/ErrorTraverse.sml Traverses new regvar-seq info and regvars in CONty.
src/Common/ErrorInfo.sml Adds new error variants/messages for regvar-seq scoping/order and ReML arity mismatches.
src/Common/ElabDec.sml Implements regvar-seq checks in type bindings and arity checks for regvar application.
src/Common/EfficientElab/StatObject.sml Extends efficient TypeFcn/TypeScheme instantiation and equality to account for regvars.
src/Common/EfficientElab/Environments.sml Updates TyName creation and primitive type function construction for new APIs.
src/Common/EfficientElab/ElabTopdec.sml Updates where type elaboration / TyName creation for new APIs.
src/Common/ERROR_INFO.sml Signature updates for new explicit-region error constructors.
src/Common/DecGrammar.sml Updates AST representation, regvar collection, and pretty-printing for regvar-seq/type application.
src/Common/DEC_GRAMMAR.sml Signature updates for the new typbind/CONty shapes and regvar collection API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

melsman and others added 3 commits February 27, 2026 00:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants