Skip to content

Profunctor Optics

May 27, 2026 · 43 min

Show notes

This episode of the Math Deep Dive Podcast tackles one of the most ubiquitous challenges in modern software engineering: the "Russian nesting doll" problem of immutable data updates. When you need to update a single zip code buried deep within nested JSON records and variants, you often face a "massive brittle wall" of boilerplate code and nested if-statements.

Join us as we explore how functional programmers and theoretical mathematicians independently converged on a universal solution: Profunctor Optics. We’ll bridge the "gritty pragmatic world of software engineering" with the "dizzying abstract heights of pure category theory" to show how complex data manipulation can be reduced to a simple dot operator.

In this episode, you’ll discover:

  • The Lenses and Prisms Dilemma: Why "AND" data (product types) and "OR" data (sum types) usually refuse to compose, and how Profunctor Optics solves this "USBC and HDMI" problem.
  • A Tale of Two Worlds: How a group of hackers in a 2015 IRC chat stumbled upon the exact same structures—Tambara modules—that mathematicians were studying in representation theory.
  • The Lattice of Optics: A "predictive periodic table" of data accessors, from simple Adapters to complex Grates and Traversals.
  • Correctness by Construction: How Co-end calculus and the "slider" mechanism allow a compiler to verify your code as a mathematical proof.
  • Beyond the Code: Mind-bending applications of optics in categorical cybernetics, Bayesian game theory, and quantum circuits.

By the end of this deep dive, you’ll see why "general abstract nonsense" is actually a gift that deletes hundreds of lines of boilerplate and ensures your systems are mathematically sound. As we peel back the layers of abstraction, we ask the ultimate question: How much of computer science is just undiscovered math?

All episodes of Math Deep Dive

Settings

Display

Language

Decides which stations you see first on the home page.

History

Recently played stations and episodes and your latest searches are only stored in this browser.

Notifications

A short notice when a podcast you follow has a new episode. Turn off single podcasts with the bell on their page.

Account

Save favorites – in the app and on the website.

Keyboard shortcuts

/
Open search
Space
Play or pause
← →
In the player: back 15 s, forward 30 s (episodes) · in a row: next tile
↑ ↓
In a row: target within the tile
Home / End
In a row: first or last tile
Esc
Close window or menu
?
This overview
Now playing

Go to station page

Play next

    Add episodes with “Play next” – they play after the current episode.