How to grasp functors and monads and don't even notice it
summary
Starts from category definitions and shows how functors and monads are concrete Scala types: a trait Functor with lift/map that must preserve identities and composition, and a Monad as an endofunctor with pure and fish (Kleisli) composition whose laws reduce to associativity and unit. Implements and verifies these laws for Option and List implementations, demonstrates flatMap/flatten behavior that collapses nested effects, and points to a GitHub repo with the runnable Scala examples.
AI-written summary · about
