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

Support type inference for recursive elements #90

Open
joshsh opened this issue Jun 12, 2023 · 3 comments
Open

Support type inference for recursive elements #90

joshsh opened this issue Jun 12, 2023 · 3 comments

Comments

@joshsh
Copy link
Collaborator

joshsh commented Jun 12, 2023

Hydra's formal data model (Lambda Graph) includes a variant of Hindley-Milner type inference which has been adapted slightly for nominal types (records, unions, and wrappers). However, while λG conceives of graphs as mutually recursive let terms and technically permits any graph which can be typed, its type inference does not extend to let terms with actual recursion -- instead, it relies on type annotations to provide the expected type, which are then simply checked for consistency. Ideally, λG would dispense with user-provided type annotations altogether, and simply disallow terms for which type inference fails. That would require a refinement of λG type inference which can in fact deal with recursion. This is to be investigated. @wisnesky has suggested HMX (reference?) constraint-based methods as an alternative to Algorithm W in Hydra.

@wisnesky
Copy link
Contributor

wisnesky commented Jun 12, 2023 via email

@joshsh
Copy link
Collaborator Author

joshsh commented Jul 15, 2023

Two other links from @wisnesky: this'n and this'n. Apparently, one should just be able to bind the let keys to type variables and let unification do its thing.

@wisnesky
Copy link
Contributor

wisnesky commented Jul 15, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants