Yer free monad on a container C is yer C*, with container morphisms in I -> C* and C*;C* -> C*, giving a monad on sets.

But -* is itself a monad on containers, with container morphisms in C -> C* and C** -> C*. That’s the free monad monad.

Kleisli arrows in the free monad monad are container morphisms in C -> D*, which act as templates for catamorphisms. For every C shape, you get a D term whose variables tell you where to substitute the results of the recursive calls from each C position.

These templates can be recovered from the function itself by perturbation testing.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://types.pl/users/pigworker/statuses/116080861784561017 on your instance and quote it. (Note that quoting is not supported in Mastodon.)