Of course, this applies to most languages where the concept of "equality" can be extended, from C++ to Haskell. You just have to rely on the implementer of the interface to obey the appropriate laws.
This is part of why dependent typing (as seen in Idris and co.) is so interesting: you can actually require, for example, that implementations of the equality interface are commutative, and this will be statically checked by the compiler.
This is part of why dependent typing (as seen in Idris and co.) is so interesting: you can actually require, for example, that implementations of the equality interface are commutative, and this will be statically checked by the compiler.