|
|
|
|
|
by bPspGiJT8Y
1061 days ago
|
|
Then why not just say that a monad (instance) is a type `t` which implements `bind :: t a -> (a -> t b) -> t b`? It's as down to earth and down to the point as it gets, and each time a new dev thinks out a code path which would lead to `t b` they'd remember `bind`. No need for containers metaphors at all. |
|
In Haskell, a Monad is a type class with a method `bind`. In Scala that would be a `flatten` or whatever.
If a person who's asking doesn't yet know what the "type class" is, or how to read signatures, your "monad tutorial" would not make much sense anywat. Guide them to learn the prerequisites first.