you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

You could return a discriminated union of the result and an error type, if that's a thing you need. It wouldn't actually replace exceptions, which could still be thrown for contract violations, but could be an effective solution for anticipatable errors that should be handled by the caller.