3 ms·
If you don't really care about the details of the unhappy path, just use Option. The real problem with exceptions is that they crash the whole program, but it's
by acjohnson55 11y ago
If you don't really care about the details of the unhappy path, just use Option. The real problem with exceptions is that they crash the whole program, but it's really difficult to know you've accounted for all possible exceptions. With pattern matching on an Option, Either, or Validation, you'll get a compile-time warning if you haven't accounted for all branches. Checked exceptions, like in Java, also have this property, they're just really awkward to use.