Professional Haskell Development Course:
Level II (Two Days)
Description: This level is for you if you have experience in another functional language or if you have some familiarity with Haskell. The goal is to make you more effective in Haskell and more fully grounded in the fundamentals of functional programming.
Self-check precondition: You have already written some Haskell programs (or have significant experience of programming in another functional programming language), fixing type errors, and building executable binaries. You are comfortable with recursive programming and higher-order functions.
Day One: Level II.A. Course Curriculum
Objective: You will be able to write Haskell programs that interact with the outside world, managing both pure and effectful operations. You will start to think of control structures as being as programmable as data structures.
1. IO Monad
- Prerequisite: Functional Algorithms
- Learning objective: Able to write programs that interact with the outside world; able to judge when to use IO and when to be purely functional.
- Content: FileIO, IORefs, do-notation, control operators (e.g., mapM, sequence), reasoning about and controlling side-effects, imperative arrays.
2. Type Classes
- Prerequisite: Functional Algorithms
- Learning objective: Able to select amongst many standard type classes (e.g., Functor, Applicative); able to define new type classes.
- Content: Eq, Ord, Read, Show, deriving, Applicative, Functor, Has-classes, multi-parameter classes (functional dependencies), constructor classes, properties of classes.
3. Encapsulation Techniques
- Prerequisite: IO Monad
- Learning objective: Able to encapsulate data and to abstract away implementation details.
- Content: Newtype, module declarations, records, OO-style IO objects.
4. Concurrent Programming
- Prerequisite: IO Monad
- Learning objective: Able to write concurrent Haskell programs using forkIO; able to select between IORefs, Mvars, and TVars.
- Content: Threads, Control.Concurrent, atomicModify, killThread, MVars as locks, STM programming.
Day Two: Level II.B. Course Curriculum
Objective: You will be able to write the kinds of programs that exist in the real world and will be able to write dynamic regression suites for those programs. You will understand the underlying computation model of Haskell sufficiently to make choices that will affect performance.
5. Monads
- Prerequisite: IO Monad
- Learning objective: Able to build new monads, understanding behavior and performance issues.
- Content: Control and data aspects including environment, state, and continuations. Monad transformers, two kinds of list monad.
6. Parsing
- Prerequisite: Monads
- Learning objective: Able to write and debug parsers.
- Content: Refresh on context-free grammars, Parsec examples, control operators, elementary error reporting, under-the-hood insight from a simple parser monad.
7. QuickCheck
- Prerequisite: Type Classes
- Learning objective: Able to write quick-check properties for existing types, to write generators for new types.
- Content: QuickCheck, principles of property-based testing, HPC coverage tools.
8. Laziness
- Prerequisite: Functional Algorithms
- Learning objective: Able to understand how laziness works, how it impacts program structuring, and how it affects performance; able to control evaluation order.
- Content: Evaluation orders, simple graph-reduction, garbage collection principles, ghc stats, programming control abstractions, lazy streams, fusion, strictness annotations, seq. (Heap visualization tool).