Skip to content

TypeRef overhaul #6

Description

@mlb2251
  • remove argcons
  • no more clone in resolve()
  • 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions