Zippers; The Theory and the Application
summary
Claims that every zipper is a comonad and that a zipper is the derivative of a data structure (McBride et al) get demonstrated with concrete encodings: a list zipper as lefts, focus, rights, and a tree zipper with parent/sibling context. Code examples in Haskell and Scala show O(1) left/right moves, modify/delete, and duplicate/duplicate-to-list. Worked examples include a CSV editor, a window manager layout (xmonad), and small proofs by algebraic differentiation to derive zipper types.
AI-written summary · about
chapters (23)
- 0:00Introduction
- 1:58Zippers
- 4:17Example
- 8:17Multiway Trees
- 9:32Siblings
- 10:18Tree Zipper
- 11:39Examples
- 13:13Functors
- 15:36Functor
- 21:06Zipper
- 26:11Python
- 27:13XMonad
- 28:49Common Question
- 30:42Context
- 33:21Algebraic Data Types
- 34:43Haskell Syntax
- 37:26Void
- 40:49a slightly trickier one
- 42:32a list of algebraically
- 43:16a list
- 45:27differentiation
- 46:17zipper without context
- 46:54list zipper








