![Scala Design Patterns.](https://wfqqreader-1252317822.image.myqcloud.com/cover/27/36700027/b_36700027.jpg)
上QQ阅读APP看书,第一时间看更新
Partial functions
Mathematics and functional programming are really close together. As a consequence, some functions exist that are only defined for a subset of all the possible input values they can get. A popular example is the square root function, which only works for non-negative numbers. In Scala, such functions can be used to efficiently perform multiple operations at the same time or to compose functions.