January 2018
Beginner to intermediate
312 pages
7h 22m
English
You’ll hear the word “composition” used a lot in functional programming—it’s the foundation of functional design. Composition just means that you can combine two things to make a bigger thing, like using Lego blocks.
In the functional programming world, we use composition to build new functions from smaller functions and new types from smaller types. We’ll talk about composition of types right now, and we’ll talk about function composition later, in Chapter 8, Understanding Functions.
In F#, new types are built from smaller types in two ways:
Let’s start with building types using AND. For example, we might say that to make fruit salad you need an apple and a ...
Read now
Unlock full access