Cotuple - A Trip to Category Theory and Back
summary
Explains that a C++ struct implements the categorical product with projection methods corresponding to getters and a unique mediating function that builds the tuple from two maps, while std::variant implements the categorical coproduct with injections (constructors) and the unique mediating morphism realized as std::visit/overload pattern matching. Shows the concrete isomorphism claims and practical mappings between category theory diagrams and C++ types and operators, and that the mappings hold as usable code patterns.
AI-written summary · about
chapters (11)
- 0:00Intro
- 0:27Types
- 0:42Projections
- 1:42Code
- 2:03Fun Fact
- 2:13Code Tuple
- 2:40Unique Function
- 2:54Tuples
- 3:18Isomorphic
- 3:36Limiting Cone
- 4:06Takeaway
related talks
59mA Tour of C++ Recognised User Type Categories
01h 23mHow C++20 Can Simplify std::tuple
05mPostmodern Meta C++
01h 04mClass Template Argument Deduction in C++17
01h 03mMonads in Modern C++
01h 16mFunctional Composition Beyond Monads
01h 12mConcept Maps using C++23 Library Tech - Indirection to APIs for a Concept
39mAre You Structure Bindable? A Tour via Concepts, SFINAE & Herb Sutter's Pattern Matching
