Sums, Products, Exponents, Monoids, Functors, Oh My!
summary
Claims that algebraic type laws make APIs predictable and reusable and demonstrates them with C++ library features: std::variant, std::optional, std::transform and ranges, plus a lazy coroutine example that implements fmap bind and join. Shows monoids enabling parallel folds and tree indexes, functors as mappable containers, monads for chaining context-bearing functions, and the derivative-of-types idea giving zipper types. Examples are small, implementable, and tested conceptually in C++ code.
AI-written summary · about
chapters (26)
- 0:00Start
- 2:29Types and Structures
- 4:06Product Types
- 6:25Void and Monostate
- 7:58Exponential Types
- 8:51Examples of Functions
- 10:55Isomorphism
- 13:16Normal Form
- 14:44Empty Type
- 17:26Recursive Types
- 20:02Algebraic Structures
- 21:44Inverse Operation
- 22:19Commutivity
- 23:08Disclaimer
- 28:12Examples of Monoidal Operations
- 29:17Operation as a Free Operator
- 31:56Groups
- 32:19Concurrency
- 36:08Inverses
- 37:32Higher Order Structures and Composing Operations
- 39:24Function Composition
- 40:52Functor
- 44:22Transform to Optional
- 48:28Arrow Function
- 52:05Associativity Rule
- 55:38Bind Operation
related talks
39mCode by Shape
59mModular Higher-Order Effects
44mTyped Design Patterns for the Functional Era
39mYou Got Your Idris in My C++! A First Look at Denotational Design
55m20000 Leagues under the FreeMonads Coproducts & purely functional DI
59mFree your functions!
01h 28mLaw of Demeter: A Practical Guide to Loose Coupling
56mMaking C++ Code Beautiful
