Functors, in Theory and in Practice!
summary
Defines functors as type constructors with a map that preserves identity and composition, and implements a Scala Functor typeclass with examples for Option, List and a custom Container. Uses Scala, Cats and discipline tests to check functor laws, demonstrates map implementations in a live demo, and explains that applicatives (pure and ap) are needed for generic insertion and multi-argument application which plain functors cannot provide.
AI-written summary · about
chapters (18)
- 0:00Start
- 3:20The map function
- 4:12A common pattern
- 6:16Type class - Definition
- 7:37Type class - Example
- 9:10Type constructor
- 10:03Functor type class - Trait
- 10:32Functor type class - Instance
- 12:16Functor type class - Laws
- 14:18Category theory
- 17:55What about Scala?
- 19:03What about Scala?
- 19:54Back to our functors!
- 22:16Functors in Scala
- 25:57Benefits - Abstraction
- 27:36Benefits - Generic transformation
- 29:50How to do it?
- 32:11Applicative functors
related talks
45mA practical introduction to Category Theory
48mCategory Theory: You Already Know It
55mCategory Theory - Part 3 of 6
46mChasing Arrows, in categories containing functors and monads
01h 11mHands on Chat About Categories
36mCategory Theory: An Abstraction for Anything
01h 15mA Crash Course in Category Theory
47mScalaFiddle and Categories
