SymbolicUtils.jl
SymbolicUtils.jl copied to clipboard
Does `Add` need symtype `<:Number`?
Currently, we have that Add
can only be used for symtypes that are <: Number
, this feels a little unnecessary. Lots of things can have a notion of addition, and it's almost always associate and commutative so it seems natural to be relaxed about what can go into Add
(even if they don't go into it by default).
It's there as an easy way to debug type promotion bugs. But yes, in theory it won't be needed.
One thing we could do is allow Add
for non-Numbers, but not expose any constructors for it, so that people who want it have to opt in manually.
Maybe a trait like Addable