Currently, we have to make almost identical patterns since we can't generalize over operators.
E.g. almost identical pattern distribution over if branches for + and & operators.
Furthermore, many operators have properties like idempotent, commutative, and associative.
So why do I have to specify both $S_X+0 and 0+$S_X for the + operator?
Note that since operators can be overloaded the properties that hold can change:
multiplication for number is commutative, and thus holds a b = b a
Yet, this is not true for matrices: matrix multiplication is not commutative!
Currently, we have to make almost identical patterns since we can't generalize over operators. E.g. almost identical pattern distribution over if branches for + and & operators.
Furthermore, many operators have properties like idempotent, commutative, and associative. So why do I have to specify both
$S_X+0
and0+$S_X
for the+
operator?Note that since operators can be overloaded the properties that hold can change: multiplication for number is commutative, and thus holds a b = b a Yet, this is not true for matrices: matrix multiplication is not commutative!