Live-coding with Universal Constructions
summary
Claim: universal constructions from category theory translate directly into runnable code, and diagrams yield concrete implementations. Live-coding translates Haskell diagrams into Scala (by composing projections and injections) to build a tiny library implementing product fanout/fanin, either/case, bimap and the distributivity map A×C + B×C → (A+B)×C. The Scala compiler needs occasional type annotations; type inference hiccups occur but code runs. Surprising result: deriving the distributivity and a point‑free implementation is easier from the universal diagrams than by ad hoc composition.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 3:13Category theory philosophy
- 10:15Product types
- 20:53Product properties
- 25:32Functoriality of products
- 34:21Sum types (Either)
- 43:44Proving distributive law
- 50:04Conclusion
related talks
52mCategory Theory Through Functional Programming (part 1/3)
01h 29mCategory Theory Track by Bartosz Milewski Part 1
57mApplied category theory and abstract algebra
40mA Pragmatic Introduction to Category Theories
42mA pragmatic introduction to Category Theory
41mA Pragmatic Introduction to Category Theory
31mA tour of String diagrams and Monoidal categories
32mClassical Category Theory in Plain Scala
