Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    Just a terminology nitpick: The Result in your example is an option-type, but it is not a monad. Commented Jul 11, 2023 at 17:07
  • 2
    Exceptions form a monad. pure is the identity function, bind is ordinary function composition, and there is no extra decoration of types needed Commented Jul 11, 2023 at 17:23
  • 5
    If I had a dollar for every time a "clever" C#/Java/etc engineer started using this kind of "result" construct, and then had to debug the failure because the next engineer didn't check isSuccess before accessing value, I'd have... well, maybe about $10 but the point is hopefully made. Commented Jul 11, 2023 at 17:37
  • 2
    Why the tag 'monad' and mention of monads in the title when there is no monad in the question? Commented Jul 14, 2023 at 20:50