3 ms·
Time for an analogy and why math is supreme: x+y+z is associative. x-y-z is non-associative. Functor, monoid and monad laws allow for undefined evaluation or
by loopz 5y ago
Time for an analogy and why math is supreme:
x+y+z is associative.
x-y-z is non-associative.
Functor, monoid and monad laws allow for undefined evaluation order, lazy evaluation, parallell execution and same results for same parameters. But only if the laws holds can such be guaranteed when using certain abstractions. Associativity being one obvious caveat that might break abstraction over collections, while using divide & conquer mechanics such as function currying.