4 ms·
> Conceptually, though, it can be treated as an error monad. Exceptions are very much not a monad, that's one of the biggest pain points about them. You can't
by kortex 4y ago
> Conceptually, though, it can be treated as an error monad.
Exceptions are very much not a monad, that's one of the biggest pain points about them. You can't map over exceptions. They are a control flow statement.
- int_19h 4y agoThey're a monad with an implicit hardcoded mapping function that's basically equivalent to Rust's "try". Yes, the fact that you can't change the function is a pain, but it doesn't preclude reasoning about them in this manner.