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.
Partial functions
Partial functions are not partially applied functions
There seems to be some confusion around what partial functions are and what they are not. It is important for you to understand that these functions are not partially applied functions. Partially applied functions are simply functions that might take multiple parameters and we've specified some of them and then they return functions with fewer...