Published: 21 August 2021
The article explains the concept of zippers in functional programming using the development of a computer game based on the Greek myth of Theseus and the Minotaur as an example. It's pretty entertaining.
- Theseus is tasked with creating the game, and he decides to represent the labyrinth as a tree
- Zippers are "a purely functional way to augment tree-like data structures like lists or binary trees with a single focus or finger that points to a subtree inside the data structure and allows constant time updates and lookups at the spot it points to"
- Zippers of different data types can literally be derived (calculus, remember?)