• barsoap@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    11 months ago

    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.

    • arc@lemm.ee
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      11 months ago

      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