jagajaga/FP-Course-ITMO

Slides and other materials for functional programming lectures ITMO university

Haskell

626

143 commits

updated Jan 17, 2022

See the code

README

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] serokell.io

Course plan

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

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

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

Presentation: https://slides.com/fp-ctd/lecture-1#/

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)

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

Lecture 3: Datas, Classes, Instances ↑

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

Lecture 4: Basic typeclasses: Monoid. Functor. Applicative ↑

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

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

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

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): https://slides.com/fp-ctd/lecture-5-part1#/

Presentation (part 2): https://slides.com/fp-ctd/lecture-5-part2#/

Lecture 6: RealWorld ↑

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

Lecture 7: Monad Transformers ↑

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

Lecture 8: Speeding up Haskell ↑

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

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)

Presentation: https://slides.com/fp-ctd/lecture-09#/

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

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

Lecture 11: Brand new DSL world ↑

  • GADTs
  • Existential type
  • Rank N types
  • DSL

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

Lecture 12: Some fun with kinds ↑

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

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

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)

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

Uncovered topics ↑

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

jagajaga/FP-Course-ITMO

Slides and other materials for functional programming lectures ITMO university

Haskell

626

143 commits

updated Jan 17, 2022

See the code

README

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] serokell.io

Course plan

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

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

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

Presentation: https://slides.com/fp-ctd/lecture-1#/

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)

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

Lecture 3: Datas, Classes, Instances ↑

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

Lecture 4: Basic typeclasses: Monoid. Functor. Applicative ↑

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

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

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

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): https://slides.com/fp-ctd/lecture-5-part1#/

Presentation (part 2): https://slides.com/fp-ctd/lecture-5-part2#/

Lecture 6: RealWorld ↑

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

Lecture 7: Monad Transformers ↑

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

Lecture 8: Speeding up Haskell ↑

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

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)

Presentation: https://slides.com/fp-ctd/lecture-09#/

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

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

Lecture 11: Brand new DSL world ↑

  • GADTs
  • Existential type
  • Rank N types
  • DSL

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

Lecture 12: Some fun with kinds ↑

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

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

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)

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

Uncovered topics ↑

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

Significant stargazers

(top 24 of 25)

Simon Jakobi

116 followers · starred Dec 2017

Jerry Zhang

295 followers · starred Sep 2016

Yury Syrovetsky

142 followers · starred Jun 2021

Jens Petersen

98 followers · starred Mar 2020