-
Notifications
You must be signed in to change notification settings - Fork 7
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
Polymorphic top-level Hugrs / Substitution across nodes of Hugr #709
Comments
So, probably this is some kind of a wrapper around (a Hugr and some TypeParams), that one can
|
This'll also give us a way to do inference separately for subgraphs and thus a better solution to inserting a subgraph than that of |
It is just possible that maybe we could treat FuncDefn as the only binder with TypeParams. We would still need a method to apply a substitution across the Hugr (i.e. |
EDIT: there are two kind-of sub-issues here:
[TypeArg]
) across the nodes/body of the Hugr, rather than just the Type of a Hugr as we have now;[TypeArg]
toinsert_hugr
and other related methodsThe former involves the bulk of coding; the latter probably not much coding but much more deciding. I'm not separating the two yet though because the former is useless without the latter (without some way to use it).
This'll be useful for #978; in time for compilation/lowering (by template-extension, rather than type-erasure/interpretation à la Tierkreis/JVM); it offers new Hugr-construction methods (alluded to in #457); it potentially simplifies tests (which could use a type variable instead of pulling in some extension just to give a concrete leaf type - although use of
USIZE_T
is widespread enough we barely notice).If we store binders separately from the Hugr nodes, then we need to be careful about additional variables bound by FuncDefn nodes, i.e. can these still see the outer binders? If so, we have a limited return of DeBruijn indices, and will probably need to pass a second
&[TypeParam]
aroundvalidate_subtree
(and a first intovalidate
) etc.The text was updated successfully, but these errors were encountered: