I was originally attracted to category theory when trying to understand Haskell optics. I was puzzled by the van Laarhoven’s functor representations and Kmett’s use of Tambara modules. By playing Tetris with the Yoneda lemma I was able to make some progress, attacking more and more esoteric topics. With a group of researcher and students at the Oxford Adjoint School in Applied Category Theory we cracked the problem of traversal optics and published a paper summarizing the advances in profunctor optics.
Optics sit at an intersection of monoidal actions and Tambara modules. There is a duality between optics and Tambara representations. It is related to what mathematicians call Tannakian reconstruction, when an algebraic object is recovered from the totality of its representations.
No wonder then that a recent article by Mateusz Stroiński, Module categories, internal bimodules and Tambara modules, piqued my interest. It turns out that Tambara modules can be thought of as horizontal arrows in a double category, which is also a proarrow equipment. I will try to sketch the contents of this paper and illustrate it using Haskell code.
The slogan is that Tambara modules are to monoidal functors as profunctors are to functors.
The main advantage of the double-categorical setting for Tambara modules is that it works out of the box for enriched categories.
Monoidal functors redux
For simplicity, I’ll be using a simplified version of a strict monoidal functor, which omits the object constraint from the definition of a monoidal category:
class (Actegory ten act1, Actegory ten act2, Functor f) => MonFunctor ten act1 act2 f where alpha :: m `act2` f a -> f (m `act1` a) alpha' :: f (m `act1` a) -> m `act2` f a
Here, alpha' is the inverse of alpha .
Monoidal functors compose:
... continue reading