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

Spec out polymorphism "extension" #433

Closed
wants to merge 4 commits into from
Closed

Spec out polymorphism "extension" #433

wants to merge 4 commits into from

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Aug 21, 2023

When we allow for type variables that could be, say, sizes of arrays, this works out worse than I thought.

* A custom OpDef `type_apply` with four type parameters:
* A list of types
* The rest as for a PolyFunc: a list of VariableIds, a set of Extensions, a list of input types, and a list of output types
* `compute_signature` computes the signature: the input is a single PolyFunc with those typeargs; the output is obtained by applying a type substitution to the input PolyFunc type, producing either a PolyFunc with fewer binders, or a general Function type (if there are no binders left). Note this `compute_signature` is fallible, so can check that the number of types in the first list is not more than the number of VariableIds.
Copy link
Member

Choose a reason for hiding this comment

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

I think partial type application and complete should be different primitives (partial is always Poly -> Poly, even if the remaining variables are 0, and complete is always Poly -> Concrete)

@acl-cqc
Copy link
Contributor Author

acl-cqc commented Aug 22, 2023

@ss2165 I think #285 now has more clarity and precision where it's useful and less detail where it isn't, compared to this - OK to just close this?

@acl-cqc acl-cqc closed this Aug 23, 2023
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