πŸ§‘β€πŸŽ“Advanced Functional Programming in Haskell

This page is based off the teachings of Professor Graham Hutton, University of Nottingham. He has approved the creation of this page and usage of his resources.

This is an advanced course on functional programming in Haskell. It is designed for second year computing students in Nottingham, but the lectures are also made available on YouTube.

The course is based on part II of Programming in Haskell. It is recommended for following the course, to purchase the below textbook, watch the youtube videos, slides are provided below to follow along, and then to try out to programming examples with resources below as well. All resources and links are provided at the bottom of the page. All credit goes to the Graham Hutton, University of Nottingham

πŸ—‚οΈ Lecture Topics

The course expands beyond the basics into advanced patterns, type classes, and program reasoning. Key lectures include:

  1. Course Overview 2–4. Sudoku Solver Series – Building and optimizing a Sudoku solver in Haskell 5–6. Functors & Applicative Functors 7–10. Monads – From basic introduction to generic laws and use cases (Maybe, List, State) 11–12. Program Reasoning & Induction 13–15. Performance & Compiler Correctness – Techniques like fast reverse/flatten and verifying compiler behavior people.cs.nott.ac.uk

Plus: YouTube playlists, overview slides, Sudoku solver code, and full standard prelude reference people.cs.nott.ac.uk


πŸ”§ Step-by-Step Learning Path

βœ… Step 1: Explore the AFP Page

Use it as your central hub for videos, slides, and example code.


βœ… Step 2: Follow Lecture Sequence

Watch in orderβ€”each builds on the previous one:

  • Lectures 2–4: Code a Sudoku solver from scratch, iteratively improving performance

  • Lectures 5–10: Deep dive into functors, applicatives, and monadsβ€”including real-world monad usage in Haskell

  • Lectures 11–12: Learn how to formally reason and prove properties about functional programs

  • Lectures 13–15: Tackle efficiency (e.g., removing append overhead) and understand compiler verification


βœ… Step 3: Read Programming in Haskell (Part II)

Highly aligns with the course. Reading alongside lectures reinforces:

  • Category-theoretic intuition behind functors/applicatives/monads

  • Inductive proofs and reasoning

  • Lazy evaluation optimizations


βœ… Step 4: Code Along & Experiment

  • Download and run the Sudoku solver code provided

  • Tinker with functor/applicative/monad instancesβ€”maybe create a small parsing program or build a custom monad

  • Implement the "fast reverse" or "fast flatten" strategies using difference lists

  • Walk through the compiler correctness lecture by experimenting with simple interpreters or compiling toy expressions


βœ… Step 5: Reason & Prove

  • Use induction and reasoning techniques shown in lectures 11–12 to validate your programs

  • Explore equational reasoning (e.g., proving map fusion or monad laws)


πŸ›  Tools You’ll Need

  • GHC – install via haskell.org

  • Editor – VS Code with Haskell extensions, or your preferred Haskell IDE

  • Hoogle – invaluable for searching type signatures and library functions

  • YouTube – study at your pace; pause and rewind where needed


πŸ’‘ Best Practices

  • Type everything by hand even if slides include code

  • Pause frequently during monad sectionsβ€”these can be non-trivial

  • When reasoning, write proofs step-by-step in your notes or code comments

  • Use Git to version control your solutions (especially for the Sudoku solver or monad experiments)


🌱 After This Course

Advanced topics you’ll be ready for next:

  • Category theory applied to Haskell (e.g., Profunctors, Arrows)

  • Concurrency and streaming libraries (e.g. Conduit, STM)

  • Formal verification tools (e.g., Liquid Haskell, Agda)

Lectures

Additional material:

Resources

Last updated