(I would expect the definition of type B to look something like “data B a = BVal a Bool”)
Pattern-matching (patterns are based on value/data constructors from data type definitions)
Types and type definitions
Type synonyms
e.g., type Point2D = (Int,Int)
Defining your own algebraic types
How many possible values / combinations of value constructors and contained values
e.g., data Foo = F1 Bool | F2 Char | F3 Bool Char
Polymorphic types (e.g., data Box a = ...)
e.g., Maybe, Either, List, Box, etc.
Type constructors vs. Value/Data constructors
Type classes and methods
Creating instances of type classes
“Kinds” of types
e.g., “ -> ”
Functors, Applicatives, and Monads
Understand conceptually what they are -- standard analogy is a “box”, but the more complicated understanding is that they represent “computational contexts”
Know the classes and methods, and what they do
Functor: fmap (aka <$>)
Applicative: pure, <*>
Monad: return (= pure), >>=, >>
Also, understand do notation!
How to translate between do notation and >>=/>>
Understand some basic Functor, Applicative, and Monad instances
Maybe
Either
List (both versions)
Functions
Logger
State (the most complicated one)
Study the stack example
Monad applications
How does do notation simplify/enable complex functions?
Mimics imperative code
But allows us to specify how state is carried through computations via monadic “plumbing”
Monadic parsing
Know how to define parser monads, and how to use them
Search is NOT on the final exam
Coding problems
Implement or use a data type and associated type class
e.g., a data structure like the list/tree, and type class that describes methods the data structure can adopt (in an instance)
Implement your own functor, applicative, monad instances of a provided polymorphic type
The type may be something that looks like a data structure (e.g., the tree from MP3), or something that looks like the state monad (i.e., a function/computation)
Monadic Parsing
Either:
Given a collection of monadic parsers & input, determine what the parsers return
Implement a collection of monadic parsers to parse/evaluate a simple language/grammar