cats.free
A stack-safe algebraic recursive fold out of the cofree comonad.
A monadic recursive fold out of the cofree comonad into a monad which can express Eval's stack-safety.
Cofree anamorphism, lazily evaluated.