Lecture Notes

Functional Programming Abstractions

These notes form an introductory course on functional programming using the Haskell programming language. They are intended to briefly present the necessary syntax and basic concepts (which are covered elsewhere in much greater depth) and focus on further theoretical exposition and examples.

Lecture code can be found in a repo here which you can clone and run yourself. It should be updated every night after lecture.

Background and Basics

  1. Getting Set Up: One way to set up a Haskell environment with stack, as well as some options for minimal tooling.

  2. Introduction to Haskell: Expressions, values, and types.

  3. Algebraic Datatypes: Defining and using types in Haskell, and the basics of type algebra.

Functional Abstractions

  1. Higher Order Functions: Functions that operate on other functions, generalizing basic functions, and defining map.

  2. Folds, Scans, and Laziness: Examining the many ways to process lists.

Type Design Patterns

  1. Typeclasses: Introducing typeclasses and polymorphism.

  2. Typeclasses II, Batteries Included: More on the built-in typeclasses in Haskell.

Algebraic Abstractions

  1. Semigroup: Abstracting compositional structures.

  2. Functor: Lifting function application to a new level.

  3. Applicative: Functions in context.

  4. Monad: It isn’t that complicated.

  5. And more to come …

Beyond Haskell

  1. Idris and Dependent Types