Partial functions

In mathematics and, as a consequence, in programming, there are functions that are not defined for all possible inputs. A simple example is the square root function—it will only work for real numbers if they are non-negative. In this section, we will look at partial functions and how we can use them.

Get Scala Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.