Classes implementing bind() are expected to satisfy three monad laws: left
identity, right identity, and associativity.
Details
The Haskell monad laws can be translated into R as follows:
- Left identity:
pure(a) %>-% his equal toh(a).- Right identity:
m %>-% pureis equal tom.- Associativity:
(m %>-% g) %>-% his equal tom %>-% \(x) g(x) %>-% h.
See also
Other implementation laws:
functor-laws