|
|
|
|
|
by maweki
2390 days ago
|
|
But usually nobody cares about or checks whether your implementation of the operator your overriding still obeys all the axioms. Sometimes we have tests whether some interface implementation fulfills some axioms, but usually we do not. Somehow with monads we do. And I suspect the reason is, that monads come from an area where of Programming where proving a program correct is preferred to testing. And for proving correctness, you need a proper specification and then implementations that follow that specification. And a specification is done using abstract concepts. If you want to prove anything about your program (or even understand obscure edge cases), concepts through examples will not work for you. |
|
Make some non-associative implementation of (+) and see on how many compilers code using it will work.