Algebraic Data Types
summary
Claims that algebraic data types are just product type = multiply and sum type = add and shows concrete JavaScript counts: a product example yields 12 combinations (3 × 2 × 2) and a sum example yields 7 options (3 + 2 + 2). Demonstrates a real bug class—mixing string and undefined—resolved by explicitly handling the string | undefined cases. Uses plain code-level reasoning and counting rather than abstract theory, so usefulness is demonstrated with numbers and a fix that actually works.
AI-written summary · about
chapters (7)
- 0:00Start
- 1:06Algebraic Data Types
- 1:21Primitive types
- 1:36Fruit Salad - a Product type
- 2:21Persona Product type
- 2:36Fruit Snack -a Sum type
- 3:52Matching Types
related talks
11mAlgebraic Data Types
55mWhy JavaScript Programmers Should Learn Algebraic Data Types
19mAlgebraic Data Types
17mHow Does JavaScript Math?
29mAlgebraic Data Types in Swift
31mProgramming Safely in an Uncertain World
25mLeveraging (algebraic data) types to make your UI rock solid
23mTruthiness, falsiness and other JavaScript gotchas
