|
|
|
|
|
by pka
2517 days ago
|
|
If you can implement flat_map [0] for something, it's (probably) a monad. You might as well call monads FlatMappables. That's the simplest, most understandable and most accurate explanation for an initial intuition I've come up with so far. [0] https://apidock.com/ruby/Enumerable/flat_map |
|
You also need to be able to "point" a pure value and have the equivalences you'd expect - this often ends up being important as e.g. the base case of a recursive function.