In previous chapters, we've seen how to build types to model many kinds of data. Through all of these chapters, we've relied on functions. Functions wrap calculations and actions for easy reuse, so it makes sense that they're among the most heavily used features in any programming language. So, by taking advantage of Reason's type system and functional programming techniques, we can design functions for maximum effectiveness.
In this chapter, we will cover the following topics:
- Meaningful function types and useful properties
- Currying and partial application
- Higher-order functions
- Using functions to control dependency ordering and program flow
- Commonly used functions and operators
But first, what is a function? A function in type theory and mathematics has a formal definition, but we can think of it as a formula for calculating...