News for hackers. Stuff that matters.
Re:What's New in Python 3.11? by kortex on Monday June 27, 2022 @09:54AM (#31894622)
> 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.

Re:What's New in Python 3.11? by int_19h on Monday June 27, 2022 @12:54PM (#31897305)
They'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.