December 2022
Intermediate to advanced
528 pages
15h 41m
English
Functional programming is centered on the use of values, produced and consumed by functions. It is therefore natural, when programming functionally, to treat failures as special values instead of using exceptions. A few standard types are commonly used to represent failures, most notably Option, Try (also called Result), and Either. These types can be manipulated by higher-order functions to process valid values and to propagate errors or to recover from them. This approach to error handling is particularly well suited to pipelined computations in which catching exceptions is unwieldy because of higher-order functions that embed their own control flow.
A component of a software ...
Read now
Unlock full access