MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.
MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.
Several parts of this course deal with the question how functional programming interacts with mutable state. We will explore the consequences of combining functions and state. We will also look at purely functional alternatives to mutable state, using infinite data structures or functional reactive programming.
Recommended background: You should have at least one year programming experience. Proficiency with Java or C# is ideal, but experience with other languages such as C/C++, Python, Javascript or Ruby is also sufficient. You should have some familiarity with using the command line. This course is intended to be taken after Functional Programming Principles in Scala (Scala 2 version)
What You Will Learn
- Recognize and apply design principles of functional programs
- Design functional libraries and their APIs
- Write simple functional reactive applications
- Understand reasoning techniques for programs that combine functions and state
Syllabus
WEEK 1
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.
WEEK 2
Lazy Evaluation
This week we'll revisit performance issues caused by combinatorial search, and we'll discover an important concept in functional programming that can address 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.
WEEK 3
Type-Directed Programming
This week, we’ll learn how to make the compiler write programs for us! We’ll see how the compiler can summon program fragments based on their type and how this mechanism can be used to implement a new form of polymorphism (type classes).
WEEK 4
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.
WEEK 5
Timely Effects
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.
MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.
MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.