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

Type-class support MVP #12

Open
yairchu opened this issue May 9, 2022 · 0 comments
Open

Type-class support MVP #12

yairchu opened this issue May 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@yairchu
Copy link
Member

yairchu commented May 9, 2022

This issue is about the ability to implement languages with type-classes. Such that LangB will have another term constructor BInstance which evaluates to a type-class instance according to its type (such as [Int] -> Json).

  • The infer of "instance" nodes should add a type-class constraint
    • For evaluation/compilation: it might be useful for the InferOf to include a reference to the term's corresponding type-class constraint so that the type-class instance can be looked up from it
  • The generated constraints can probably be resolved/simplified in a post-process after the inference, that matches them with existing instances. For example [Int] -> Json can be resolved by a -> Json => [a] -> Json and Int -> Json.
  • TODO (flesh-out): We should consider the interactions with let-generalization and to-nom
@yairchu yairchu added the enhancement New feature or request label May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant