An exception is an abnormal runtime condition that interrupts normal computation and can be handled separately. In functional programming, throwing one is treated as a side effect because it breaks referential transparency and makes meaning depend on evaluation context. section 4.1
Throwing and catching
A function can throw inside a try expression and recover with a catch clause. The same thrown expression may instead escape when evaluated elsewhere, showing that its meaning depends on the surrounding try block. section 4.1
Exceptions create two central problems:
- Break local reasoning by making expression meaning context-dependent. section 4.1
- Hide possible failure from function types, allowing unhandled errors to survive until runtime. section 4.1 section 4.6
- Replace recoverable exceptions with ordinary values such as Option, Either, Try, or Validated, whose higher-order functions compose failure handling. section 4.5 section 4.6
























