Understanding Actegories: The Hidden Math Behind Lenses and Prisms

Understanding Actegories: The Hidden Math Behind Lenses and Prisms

I explore actegories, a mathematical concept central to programming optics like lenses and prisms. By defining monoidal categories and their actions on other categories, I show how these structures model 'scaling' operations. Using Haskell, I demonstrate how to implement these abstract ideas, revealing the elegant algebraic foundations that power modern functional programming patterns.

In programming, actegories play a central role in optics: lenses, prisms, traversals, etc.
  1. lyall

    If you saw TFA and thought "hmmm yes, I know some of those words", then I can recommend the author's own lecture series on YouTube [0]. It's an intro to and overview of category theory aimed at programmers, with the requisite context and motivation for why anyone should care. It's long but worth the time investment IMHO.

    0: http://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7...

  2. ultimatefan1

    this has a real "a monad is a monoid in the category of endofunctors" energy to it

  3. xqb64

    I'd like to understand how and why this stuff is useful for programmers.

More from this day

2026-07-14