February 2018
Beginner
200 pages
4h 37m
English
Controlling the program flow means controlling which functions and expressions will be executed. Imperative languages rely mainly on conditional constructors like if, but here in the functional world, pattern matching plays the central role. However, pattern matching is often misunderstood and hard for beginners to comprehend. That’s why half of this chapter is dedicated to understanding pattern matching. Then we’ll use pattern matching to decide which function to dispatch so we can have a control flow mechanism. By the end of this chapter, we’ll see some Elixir control-flow structures that use logical and pattern-matching expressions to simplify common expressions. Let’s take the ...
Read now
Unlock full access