Functor Zoo
summary
Demonstrates concrete Python code using the FunkLIFT library to treat collections and effects as functors: maps a list [1,2,3,4] with CList.fmap, wraps console reads as an IO functor and defers side effects via an unsafe_run, turns a partial modulo-by-zero into a composable Option/applicative value and shows composition with Compos to map inside nested containers. Shows bifunctor Either with left/right mapping and profunctor examples like Star using dimap to build composable data pipelines.
AI-written summary · about
chapters (33)
- 0:00intro
- 0:20preamble
- 0:31about this talk
- 1:06about me
- 1:21agenda
- 1:32a function
- 1:58another function
- 2:16category of types (t)
- 3:01list of numbers
- 3:27clist of numbers
- 4:01clist is a functor
- 4:49io side effects
- 6:06io functor
- 6:58partial function
- 7:37not very composable
- 8:15option for better composability
- 9:01option is a functor
- 9:18composing functors
- 10:26category od small categories
- 10:44example of clist . option
- 11:31covariant functor in general
- 12:07contravariant functor
- 12:43predicate is a contravariant functor
- 13:24closed category
- 15:58applicative functor is lax closed functor
- 16:22example of applicative functor
- 17:29bifunctor
- 18:47example of bifunctor
- 19:38profunctor
- 21:05forget
- 21:16star and costar
- 21:44example of star profunctor
- 22:57summary
related talks
43mFunctional Programming with Effects
44mFunction reuse is just wishful thinking
29m“Functional programming: functors and monads"
01h 16mFunctional Composition Beyond Monads
01h 06mThe Functional Programmer's Toolkit
35mThe Functor, Applicative, Monad talk
31mAbstract your representation and fix your functors
50mFunctional Programming with Effects
