Monoids, Monoids, Monoids
summary
Argues that monoids underlie many Scala patterns and shows concrete code-level uses: integer addition, string concat, set union, Option and tuple monoids, Map merge using a value monoid, and IO/Future sequencing. Demonstrates parallel aggregation with FS2 mapAsync + chunk + combineAll to fold large streams deterministically, and uses Cats + discipline for property tests. Notes Rubik's Cube as a permutation group (~4.6×10^19 permutations), experiments with Scala 3 union types as bounded semilattices, and reports the prototype designs compile and behave as expected.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:57What are monoids
- 8:43Monoid laws
- 13:18Beyond monoids
- 24:13Advanced algebraic structures
- 30:51Type-level monoids
- 41:24Monoids in libraries
- 47:07Union/intersection types
- 53:05Conclusion and key takeaways
related talks
29mMonoids and Software Engineering
34mThe Monoiad: an epic poem on monoids
35mThe Functor, Applicative, Monad talk
42mMonads you already use without knowing it
42mA pragmatic introduction to Category Theory
01h 03mIntro to FP in Scala: Exploring a Toolbox for Solving Problems - Part 4 of 6
36mAn introduction to monadic structures and functional programming
46mOptimusPrimeT
