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

Replace type schemes with forall types #76

Closed
joshsh opened this issue Mar 23, 2023 · 2 comments
Closed

Replace type schemes with forall types #76

joshsh opened this issue Mar 23, 2023 · 2 comments
Assignees

Comments

@joshsh
Copy link
Collaborator

joshsh commented Mar 23, 2023

Hydra uses Hindley-Milner type inference, but its actual type grammar has moved on from Hindley-Milner to System F. Rather than inferring type schemes, Hydra must now infer forall types -- the main difference being the ordering of type variables. Since the algorithm is still Hindley-Milner, forall types will only be produced at the top level; they will be eliminated from subterms. Previously, all elements (top-level terms with names) had to be manually annotated with types anyway, so there was no need to get forall types right. Now it should be possible to omit all type annotations except in the case of cycles.

@joshsh joshsh self-assigned this Mar 23, 2023
@joshsh
Copy link
Collaborator Author

joshsh commented Feb 29, 2024

Done in #103. Possibly superseded by #118 (which only uses type schemes internally, for STLC to F).

@joshsh
Copy link
Collaborator Author

joshsh commented Jul 30, 2024

We are actually going back to type schemes for now. Again, the overriding concern right now is translatability, although symmetry between the term grammar and the type grammar is still a concern as well. Every let-binding is potentially annotated with a type scheme, and type variables are not introduced anywhere else.

@joshsh joshsh closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant