wax :: IO FunctionalWorkshop
Collection of training materials for the functional workshop.
Day 1: Go to the classes to meet your type classes
Plan
- Type classes.
- Introduce the problem.
- Abstraction.
- Composability.
- Extensibility.
- Use example with code we don’t own.
- Solve the problem with wrappers.
- Introduce idea of the type classes.
- Implicits (Haskell: show the difference).
- Introduce the problem.
- Semigroup.
- Formal definition.
- Informal definition with example in host language.
- Note importance of laws for type classes.
- Instance examples.
- Checking the laws.
- Manually (pen and paper).
- Automatically (property based testing).
- Note that it’s very common for the data types to have multiple instances of semigroup.
- More examples of semigroups.
- H/W: write an instance that breaks the laws.
- Monoid.
- Format definition.
- Informal definition with example in host language.
- Monoid laws.
- Instance examples.
- Not all semigroups are monoids. Provide examples.
- Workshop.
- Fibonacci.
- Calculate top used words in huge amount of files.
- Logging.