I'm not super familiar with Rust or MyPy, but I was wondering if you could mention what the distinction is between returning a Result vs e.g. a type hint for returning an exception
Maybe because Result is a monad, an Either monad to be precise.
Monads have been implemented in many languages without the developer even knowing, the best example IMHO are Javascript's Promise which are Continuation Monads.
5 comments
[ 2.1 ms ] story [ 23.7 ms ] threadThis allows you to write your full algorithm/computation, and handle the final result afterwards.
Monads have been implemented in many languages without the developer even knowing, the best example IMHO are Javascript's Promise which are Continuation Monads.