Slides and other materials for functional programming lectures ITMO university
Switch branches/tags
Nothing to show
Clone or download
Latest commit a275c1e Jun 12, 2018

README.md

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

Lecture 1: Why FP and Haskell (by Arseniy Seroka)

Presentation (ru): http://camlunity.ru/swap/haskell/whyhaskell.pdf

Lecture 2: Basic Syntax (by Dmitry Kovanikov)

  • 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)

Presentation: http://slides.com/fp-ctd/lecture-2#/

Lecture 3: Datas, Classes, Instances (by Dmitry Kovanikov)

Presentation: http://slides.com/fp-ctd/lecture-3#/

Lecture 4: Kinda monoidal types (by Dmitry Kovanikov)

Presentation: http://slides.com/fp-ctd/lecture-4#/

Lecture 5: Monads, part 1 (by Dmitry Kovanikov)

  • Talk about boxes
  • What is Monad?
  • Monad type class
  • Monad laws
  • Maybe as example, philosophy about null-safety
  • Equational reasoning
  • Proving Monad laws for Maybe
  • Identity monad instance
  • Either monad instance
  • Monad composition
  • List monad instance
  • then : >>
  • List monad nondeterminism
  • join
  • Weird custom monads
  • Useful Monad functions

Presentation: http://slides.com/fp-ctd/lecture-5#/

Lecture 6: Functors, Applicative Functors (by Arseniy Seroka)

Presentation: http://slides.com/fp-ctd/lecture-6#/

Lecture 6.5: Parser combinators and Property-based-testing (by Dmitry Kovanikov)

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

Presentation: http://slides.com/fp-ctd/lecture-65#/

Lecture 7: Monads, part 2 (by Dmitry Kovanikov)

  • Writer monad
  • Reader monad
  • Typed holes
  • Partial type signatures
  • State monad
  • Cont monad and Continuation Passing Style (CPS)

Presentation: http://slides.com/fp-ctd/lecture-7#/

Lecture 8: RealWorld (by Arseniy Seroka)

Presentation 8: http://slides.com/fp-ctd/lecture-8#/

Lecture 9: Monad Transformers (by Arseniy Seroka)

Presentation: http://slides.com/fp-ctd/lecture-9#/

Lecture 10: Speeding up haskell (by Dmitry Kovanikov)

Presentation: http://slides.com/fp-ctd/lecture-10#/

Lecture 11: Template Haskell and Lens (by Arseniy Seroka)

  • 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

Presentation: http://slides.com/fp-ctd/lecture-11#/

Lecture 12: Parallel and Concurrent Haskell (by Dmitry Kovanikov)

  • 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

Presentation: http://slides.com/fp-ctd/lecture-12#/

Lecture 13: Comonads (by Arseniy Seroka)

  • 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

Presentation: http://slides.com/fp-ctd/lecture-13#/

Lecture 14: Enterprise Haskell (by Arseniy Seroka)

Presentation: http://slides.com/fp-ctd/lecture-14#/

Lecture 15: Advanced type features (by Dmitry Kovanikov)

Presentation: http://slides.com/fp-ctd/lecture-15#/

Lecture 16: Idris (by Dmitry Kovanikov)

  • 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 :(