3 ms·
Most people start using Result/Either[0] when they need to define a reason for a value being missing. Then you can decide how to handle arbitrarily different ca
by jolux 6y ago
Most people start using Result/Either[0] when they need to define a reason for a value being missing. Then you can decide how to handle arbitrarily different cases of failure with pattern matching, or handle them all the same. The error types themselves are not standardized as far as I know, but I'm not sure how useful it is to standardize these differences at the language or standard library level. Is the theory that people don't use the Result type correctly as is?
[0]
https://doc.rust-lang.org/std/result/ https://doc.rust-lang.org/std/result/
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Result.html https://caml.inria.fr/pub/docs/manual-ocaml/libref/Result.ht...
https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-Either.html https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-...