/FP-Course-ITMO

Slides and other materials for functional programming lectures ITMO university

Primary LanguageHaskell

Haskell ITMO course at CTD

Here you can find plan and presentations on the Haskell course authored by Dmitry Kovanikov and Arseniy Seroka.

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

Course plan

All slides: https://slides.com/fp-ctd

Templates for homework: https://github.com/ChShersh/fp-homework-templates

Introductory presentation: here

  • GHC, GHCi
  • Haskell project structure
  • Stack. Features
  • How stack works. Snapshots
  • .cabal and .yaml files
  • Basic comands
  • 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)
  • 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
  • Idea of parsing and parser combinators
  • Parser type
    • Basic parsers
    • Instances: Functor, Applicative, Monad, Alternative
    • Usage examples
  • Testing
  • 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
    • Boilerplating tuple code
    • Haskell AST
    • Splices
  • -XQuasiQuotes
  • Generate instances with TH
  • Advantages of immutability and purity
  • Haskell parallelism with rpar and rseq
  • Spark pool, GC and sparks
  • Threadscope
  • Strategies
  • Par monad examples
  • Difference between Parallelism and Concurrency
  • forkIO and MVar
  • Transactions: STM, TVar
  • Async
  • Comonad type class & motivation
  • Zippers
    • List zipper
    • Game of Life
  • Indexed array comonad for image processing
  • Comonadic 2D-parser
  • 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)
  • Comonad transformers
  • Idris tutorial
  • Idris course
  • Paradigms
    • Totality
    • Strict evalution
    • Theorem proving
    • DSL
    • Extensible effects
  • Syntax difference with Haskell
    • : for type and :: for cons
    • Function overloading
    • Named typeclasses
    • !-idiom
    • [| |]-idiom
    • Records
  • Dependent types
    • Vect data type
    • drop for Vect
    • isEmpty : Vect n a -> Bool
    • isSingleton : Bool -> Type
    • Open and closed doors
    • Total version of head function
    • _|_-eliminator
    • Dependent pair and filter for vectors
    • Type safe printf implementation
  • Simple examples of Eff
    • Tagging tree with labels (and counting leaves)

Uncovered topics

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