Currently we use named tuples to hold our rules for type inference and overloading but that means we have massive type signatures in each of our functions. We should instead just use structs to hold this same information.
Instead of something like op2_rules::Vector{NamedTuple{(:proj1_type, :proj2_type, :res_type, :resolved_name, :op), NTuple{5, Symbol}}} we could just have op2_rules::Vector{Op2Rule}, holding the same information.
We might even be able to tie groups of rules together, like type rules, with an abstract type that allows us to dispatch and choose the correct type inference application function.
Yes that makes sense to me. If you have multiple functions that take namedtuples with the same signature, then make it a struct. It should be exactly the same performance-wise.
Currently we use named tuples to hold our rules for type inference and overloading but that means we have massive type signatures in each of our functions. We should instead just use structs to hold this same information.
Instead of something like
op2_rules::Vector{NamedTuple{(:proj1_type, :proj2_type, :res_type, :resolved_name, :op), NTuple{5, Symbol}}}
we could just haveop2_rules::Vector{Op2Rule}
, holding the same information.We might even be able to tie groups of rules together, like type rules, with an abstract type that allows us to dispatch and choose the correct type inference application function.