Typeclasses: the value of programming vocabulary
summary
Defines typeclasses as interfaces with laws and shows concrete Haskell code: an EQ instance for a traffic light algebraic type used with nub to remove duplicates, and a Functor instance with fmap for lists and a recursive tree (empty stays empty, node maps value and recurses). Explains the two Functor laws (fmap id and composition) and points to the Elixir library at github.com/expede/witchcraft as the practical way to explore these patterns in Elixir.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 2:13Haskell
- 3:42Arcane spells
- 4:22What are they
- 4:53Erlang spells
- 5:33Elixir spells
- 5:57Type classes
- 7:31EQ Haskell
- 8:29Algebraic Data Types
- 9:22Implementing the Interface
- 10:34Functor
- 11:39FunkMap
- 12:18Tree
- 13:16Fmap
- 14:03Eid
- 15:57Funktoes
- 16:51Applicative
- 17:45Elixir Land
- 18:06Witchcraft
- 18:29Conclusion
- 19:13George Orwell 1984
- 19:43Questions
related talks
30mWriting extensible functional code
31mTotal Type Classes
56mCategory Theory Through Functional Programming (part 2/3)
42mWhat did category theory do for us?
11mHigher order Abstractions
57mApplied category theory and abstract algebra
37mFireside chat on bringing more FP to Elixir
52mCategory Theory Through Functional Programming (part 1/3)
