Skip to content

Fix subexpression purity check#126

Merged
DanGooding merged 20 commits intomainfrom
fix-subexpression-purity-check
Oct 8, 2025
Merged

Fix subexpression purity check#126
DanGooding merged 20 commits intomainfrom
fix-subexpression-purity-check

Conversation

@DanGooding
Copy link
Copy Markdown
Owner

Fix bug where we erroneously assume a subexpression is pure. This occurs in cases of higher-order functions, since the subexpression effect's lower bound is the effect of the passed callback function. There was a problem with polar-type expansion where we'd end up treating the effect as total.

Fix so that when expanding types/effects, we only remove metavariables which do not appear in negative position in the type signature - i.e. are not chosen by the caller.

@DanGooding DanGooding added the bug Something isn't working label Oct 8, 2025
@DanGooding DanGooding merged commit abbee17 into main Oct 8, 2025
1 check passed
@DanGooding DanGooding deleted the fix-subexpression-purity-check branch October 8, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant