3 ms·
A Monad is just something to which certain properties apply. An easier example to grasp is a Monoid, which is anything that has an associative binary operator,
by kaba0 3y ago
A Monad is just something to which certain properties apply. An easier example to grasp is a Monoid, which is anything that has an associative binary operator, and an identity element. E.g. nonnegative integers’ addition with 0 is such. Or any list with a concat operation, and the empty list.
So even in weaker languages you get monads the difference is that you can’t abstract over them. Your Haskell code can take a Monad, and work with those, most other languages (I believe Rust included) can’t handle them uniformly all over the language. But they can have types that are mathematically speaking monads.