For Expressions and Monads
We'll start by revisiting some concepts that we have learned from Principles of Functional Programming in Scala; collections, pattern matching, and functions. We'll then touch on for-comprehensions, a powerful way in Scala to traverse a list, process it, and return a new list. We'll see how to do queries with for-comprehensions as well as how the for-comprehension is "desugared" into calls to higher-order functions by the Scala compiler. Finally, we'll discuss what monads are, and how to verify that the monad laws are satisfied for a number of examples.
This week we'll revisit performance issues caused by combinatorial search, and we'll discover an important concept in functional programming that can these issues: laziness. We'll also learn a little bit about proofs on trees; in particular, we'll see how to extend structural induction to trees.
Functions and State
This week, we'll learn about state and side-effects. Through a rich example, we'll learn programming patterns for managing state in larger programs. We'll also learn about for-loops and while-loops in Scala.
This week we'll learn a number of important programming patterns via examples, starting with the observer pattern, and then going on to functional reactive programming. We'll learn how latency can be modeled as an effect, and how latency can be handled with Scala's monadic futures. We'll learn the important combinators on futures as well as how they can be composed to build up rich and responsive services.