Damus
Conor Titania Mc Bride profile picture
Conor Titania Mc Bride
@Conor Titania Mc Bride
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.
1
Dan Piponi · 24w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqw4y42l2xu0p3a9yrfecmmsmlvhzrk3xe67vp0gpfw55q8s3kz2hsrzxhtk I tend to think of these Kleisli arrows as some kind of staging in a compiler so your use of the term "template" may be similar to a C++ template, I'm not sure. Anyway, looking forward t...