Refactor closure_tyvars_let_decl
to avoid type variable duplication
#47
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.
When evaluating the following expression:
type abstractions are inserted as:
As seen here, the type variable
'x10
appears twice. This duplication happens because the return values ofclosure_tyvars_let_decl
andclosure_tyvars2
are not mutually exclusive.To address this, I made the following changes:
closure_tyvars_let_decl2
, which behaves likeclosure_tyvars2
but excludestv_exp v1
instead offtv_exp v1
.closure_tyvars_let_decl
toclosure_tyvars_let_decl1
.This change does not affect practical behavior, but it may be relevant in theoretical contexts.
Let me know if you have any feedback or if this can be merged.