Generic matrix multiplication using typeclasses

When I said " Monoid should not be modeled like that", I didn’t mean your code but the fact of using typeclasses (or at least implicit typeclasses if you please).

BTW:

That is what cats do, it encodes the laws of the typeclasses as some property test.

Sure, as I said multiple times now, my point is not that your code is wrong, is just that is not a good example to learn typeclasses; which, IIRC, was your primary goal.