The Road to Functional Programming

Educational material to learn functional programming in Scala, from scratch, in a structured and comprehensive way.

View project on GitHub

The road to FP

At the moment this page is just a dump of raw ideas of what to put in the various chapters and to have a rough organization of the content. The topics below will have to be properly expanded, with references, comments, examples and exercises.

Target of this content

  • To learn functional programming applied to Scala
  • To be able to understand the existing online materials
  • To be able to use the main FP libraries
  • To have an intuition of the theory behind FP
  • To become fluent in the majority of FP concepts, tools and techniques

Different way of thinking

  • Put aside all other paradigms, you’ll need to learn afresh
  • Paradigm shift: tons of new concepts, structures, techniques, abstractions
  • Declarative programming, cleaner way of thinking
  • Abstract over implementation details
  • Ease of reasoning with black-box approach
  • FP referential transparency makes things cumbersome. Requirements of new tools
  • The unfortunate way of learning FP in Scala: Haskell, few books, blog posts
  • Composability
    • Design and analysis approaches: blackbox, top-down, bottom-up
    • Composition of blocks
    • Programming languages and modularity

Scala language feature: Case classes

Definition of pure functions and referential transparency

Recursion

Scala language feature: Lazyness

Purely functional data structures

Scala language feature: Higher order functions

Functors and the world of containers

Scala language feature: Typeclasses

Monoids

Applicative functors

Optics

Introducing monads

Most common monads

Handling errors in FP

Monad transformers

Free applicatives and free monads

Tagless final

Comonads

Recursion Schemes

Introduction to Category Theory

Basic concepts of Category Theory

Revisiting structures and tools using Category Theory

Few concepts in Type theory

Type Level Programming