feat(data/matrix/basic): generalize to non_assoc_semiring (#7974)
Matrices with whose coefficients form a non-unital and/or non-associative ring themselves form a non-unital and non-associative ring.
This isn't a full generalization of the file, the main aim was to generalize the typeclass instances available.