Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Haskell ITMO course at CTD

Here you can find plan and presentations on the Haskell course authored by Dmitry Kovanikov and Arseniy Seroka with subsequent contributions by George Agapov, Ilya Peresadin, Roman Melnikov and Artem Yurchenko.

This course is always under development and always improving constantly because there's no limit for the best Haskell course.

You can always contact us via fp.ctd.itmo [at]

Course plan

All slides:

Templates for homework:

Lecture 0: Why FP and Haskell

Introductory presentation: here

Lecture 1. Stack. How to build/run/test

  • GHC, GHCi
  • Haskell project structure
  • Stack. Features
  • How stack works. Snapshots
  • .cabal and .yaml files
  • Basic comands


Lecture 2: Basic Syntax

  • Introduction to Haskell
    • Basic GHCi examples
    • Function & operators definition
    • Lists and functions on lists
  • Haskell syntax
    • let (variable declaration)
    • where clause
    • if expression
    • Guards
    • case expression
    • Higher order functions
    • Lambdas (anonymous functions)
  • Polymoprhism
    • Parametric
    • Ad-hoc
  • LANGUAGE pragmas
  • Currying (aka partial application)
  • Pattern matching
  • List comprehension
  • Function application: ($)
  • Function composition: (.)
  • Lazy evaluation (erathosphene sieve, fibonacci numbers, repmin)


Lecture 3: Datas, Classes, Instances


Lecture 4: Basic typeclasses: Monoid. Functor. Applicative


Lecture 5: Monads

  • Typed holes
  • What is Monad?
  • Monad type class
  • Monad laws
  • State monad
  • Reader monad
  • Maybe as example, philosophy about null-safety
  • Either monad instance
  • Monad laws


Slides: Parser combinators and Property-based-testing

  • Idea of parsing and parser combinators
  • Parser type
    • Basic parsers
    • Instances: Functor, Applicative, Monad, Alternative
    • Usage examples
  • Testing

Presentation (part 1):

Presentation (part 2):

Lecture 6: RealWorld


Lecture 7: Monad Transformers


Lecture 8: Speeding up Haskell


Lecture 9: Parallel and Concurrent Haskell

  • Concurrency with Haskell lightweight threads. forkIO and MVar.
  • Synchronization between threads
  • Exceptions revisited
  • Async
  • STM (Software Transaction Memory). STM, TVar.
  • Parallelism with Sparks. Eval monad
  • Inspecting your concurrency (ThreadScope)


Lecture 10: Template Haskell and Lens

  • Lens
    • Implementing naive data lenses
    • Introducing real Lens'
    • lens, view, set, over definition and explanation
    • 3-step lens guide
    • microlens-family
    • Nice example with real lens (view, traversed, filtered, zoom)
    • Prism
    • Affine traversals
  • -XCPP
  • Template Haskell


Lecture 11: Brand new DSL world

  • GADTs
  • Existential type
  • Rank N types
  • DSL


Lecture 12: Some fun with kinds

  • Kinds
  • -XTypeOperators
  • -XDataKinds. Data promotion
  • Heterogeneous lists
  • Type symbols
  • Data and type families
  • Free monads


Lecture 13: Comonads

  • Comonad type class & motivation
  • Zippers
    • List zipper
    • Game of Life
  • Type algebra
    • Types as functions (sum, product, type variables)
    • Type isomorphisms
    • Zippers as deriviation: List zipper, Tree zipper
  • Comonads as OOP patterns
  • codo-notation (aka method)


Uncovered topics

Unfortunately there're some topics which are great but there is no time for them in this course :(


Slides and other materials for functional programming lectures ITMO university






No releases published


No packages published