Skip to content
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

Restore support for explicit type signatures on polymorphic functions #2205

Merged
merged 4 commits into from
Jan 29, 2025

Conversation

sauclovian-g
Copy link
Contributor

No description provided.

Typechecking updates some the AST elements with additional
information, including Pattern, and some (but not all) of the code
paths were discarding the updated Pattern. It's not clear if this was
actually causing any real problems, but it's wrong and it seemed like
a good idea to fix it before tinkering with patterns further.

(which then didn't happen because the original approach to the
upcoming stuff didn't work out, but anyway...)
@sauclovian-g sauclovian-g force-pushed the 2204-polymorphic-signatures branch from 45a4ad9 to 0a078e1 Compare January 29, 2025 06:35
Comment on lines 895 to 898
-- Get the free type variables found in a chain of Function Exprs.
inspectLambdaFTVs :: Expr -> TI (Expr, Map Name Pos)
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure to also document the meaning of the Expr that is returned here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done (I squashed it in and force-pushed to reduce noise)

…aders.

This restores the ability to write functions of the form
   let f (x: a) (y: a) = (x, y);
which were rejected after #2077 was fixed.

Closes #2204.
@sauclovian-g sauclovian-g force-pushed the 2204-polymorphic-signatures branch from 3faf447 to 4d87626 Compare January 29, 2025 19:53
@sauclovian-g sauclovian-g merged commit 98ce44f into master Jan 29, 2025
10 checks passed
@sauclovian-g sauclovian-g deleted the 2204-polymorphic-signatures branch January 29, 2025 19:54
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