The exception handling question mark, spelled ? and abbreviated and pronounced eh?, is a half-arsed copy of monadic error handling. Rust devs really wanted the syntax without introducing HKTs, and admittedly you can’t do foo()?.bar()?.baz()? in Haskell so it’s only theoretical purity which is half-arsed, not ergonomics.
The exception handling question mark, spelled
?
and abbreviated and pronouncedeh?
, is a half-arsed copy of monadic error handling. Rust devs really wanted the syntax without introducing HKTs, and admittedly you can’t dofoo()?.bar()?.baz()?
in Haskell so it’s only theoretical purity which is half-arsed, not ergonomics.You can say it’s half-arsed if you like, but it’s still vastly more convenient to write than if err != nil all over the place