You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
switch RawTypeRef to just be an Idx and switch around all the methods as appropriate to give the more ergonomic .get() api that Exprs use. This will maintain the nice feature that unshifted DSL functions can just be referred to as Idx so it's type-enforced that you dont actually treat them as a type.
then switch from TNode term being Term(Symbol, Vec<Idx>) to Term(Symbol, Vec<TypeRef>). In the case of top down these inner typerefs would always have zero shift, but for stuff like .infer() they will come in handy. The hope is that they'll be zero overhead which they should be since we never end up changing them. Methods that traverse thru them will ofc add the shifts as they are encountered - this is likely nicely automated in fact.
then introduce Arrow(Vec<Id>,Idx) in TNode bc as jack says you never need to partial apply during top down so this will save on pointer chases
write .infer() which should be easy, the arrow construction is the only part that takes effort
re-add the debug_assert with .infer() into top_down
if possible, remove .collect::<Vec<_>>() from unify(), or otherwise track down whats slow in unify() bc it might not be that. Or use a smallvec?
RawTypeRefto just be anIdxand switch around all the methods as appropriate to give the more ergonomic .get() api that Exprs use. This will maintain the nice feature that unshifted DSL functions can just be referred to as Idx so it's type-enforced that you dont actually treat them as a type.Term(Symbol, Vec<Idx>)toTerm(Symbol, Vec<TypeRef>). In the case of top down these inner typerefs would always have zero shift, but for stuff like .infer() they will come in handy. The hope is that they'll be zero overhead which they should be since we never end up changing them. Methods that traverse thru them will ofc add the shifts as they are encountered - this is likely nicely automated in fact.Arrow(Vec<Id>,Idx)in TNode bc as jack says you never need to partial apply during top down so this will save on pointer chases.collect::<Vec<_>>()from unify(), or otherwise track down whats slow in unify() bc it might not be that. Or use a smallvec?