Intro to FP in Scala: Exploring a Toolbox for Solving Problems - Part 4 of 6
summary
Shows live Scala code proving how generic type classes solve concrete problems: implements folding with Foldable/foldMap and monoids to avoid ad hoc zeros, collapses nested effects with join for F[F[A]], and turns lists of tasks into a single task with Traverse.sequence/traverse. Walks through a map-merge exercise using monoid instances and a cache vs repository test that demonstrates brittle mocks and why abstract signatures plus applicative/monoid instances reduce accidental coupling.
AI-written summary · about
chapters (10)
- 0:00Intro to generic problem solving
- 1:41Fold with semigroups and monoids
- 5:18Generalizing fold with type classes
- 11:57Scala’s multiple parameter lists
- 24:59Nested futures and tasks in real world
- 36:49Merge function exercise intro
- 41:49Merge function with monoids
- 47:43Testing and mocking in FP design
- 58:01Mock-based testing limits
- 1:00:19Compiler-enforced dependency contracts
related talks
01h 00mWhat The Functional Programming
31mWhat I Learned about FP when Writing a Book About It
19mScala for the Rest of Us
01h 02mPrinciples and tools to cleverly model your data in Scala
49mRelax, It's Just FP
35mThe Functor, Applicative, Monad talk
48mObject Functional Programming
55mMonoids, Monoids, Monoids
