- Introduction to algebraic data types
- Record syntax, fields, and functions
- Product types (constructors with more than one argument)
- Sum types (tagged unions)
- Polymorphic types (product and sum)
- Exploiting the type system
- The data keyword
- Type constructors vs. data constructors
- Type constructors are used in type signatures
- Data constructors are used in patterns and code
- Records look sort of like a C struct
- Fields turn into functions
- Record update syntax (sucks)
- Data constructors that have more than one type
- Records with more than one field are product types
- Pattern matching to get the fields
- Multiple data constructors
- Canonical example: Bool = False | True
- Compared to a C enum
- Pattern matching on all data constructors
- The type constructor uses type variables
- The Maybe and Either types
- Binary tree example
- Preventing SQL injection attacks
- Software Transactional Memory