This course introduces three main advanced functional programming topics: monads and monadic programming, applicative functors, and type-level computing. Frameworks of the Scala functional ecosystem such as cats and shapeless will be used throughout the course. Special emphasis is given in showing the problems that these abstractions and patterns are intended to solve, and the gains in modularity, reuse and evolvability that they offer.
AUDIENCE
- Programmers who are familiar with the basic traits of functional programming (ADTs, HOFs & type classes) and are willing to take the next steps so as to fruitfully exploit advanced libraries of the Scala ecosystem like cats and shapeless
COURSE OUTLINE (16 hours)
MODULE 1. Topics and the functional ecosystem of Scala
- Advance topics: GADTs, MTL, tagless-final, type constructor classes, etc.
- Ecosystem overview: scalaz/cats/zip, scalacheck & shapeless
MODULE 2. Monadic programming
- Monad classes: Error, Plus, State
- Monad transformers: OptionT, EitherT, StateT
MODULE 3. Applicative programming
- Applicative functors
- Error handling with Validation
- Foldable, Traversable
MODULE 4. Type-level programming
- Shapeless overview
- HList, Coproduct and Fix
- Automatic type class derivation