- Date & Time: May 2, 8AM-10AM, in SB113
- One page of letter-sized, double-sided notes is permitted
- Cumulative!! But focus on material covered after midterm
- Exam organization: roughly 30-40% conceptual (MC/objective) questions, 60-70% written/coding questions

- Basic Haskell syntax
- Maybe study type declarations
- e.g., foo :: B (a -> b -> c) -> B a -> B b -> B c
- (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)

- Maybe study type declarations
- Types and type definitions
- Type synonyms
- e.g.,
`type Point2D = (Int,Int)`

- e.g.,
- 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`

- e.g.,

- How many possible values / combinations of value constructors and contained values
- 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., “
*->*”

- e.g., “

- Type synonyms
- 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 >>=/>>

- Also, understand do notation!

- 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

- How does do notation simplify/enable complex functions?
- Search is NOT on the final exam

- 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

- Either: