Recursion Schemes - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Jan van Brügge

Is there a recursion scheme that builds up a new structure while folding?
Basically I want something like (f a -> (a, f b)) -> Fix f -> (a, Fix f)

Jan van Brügge

ie a bottom up traversal like cata, but returning a new tree using the info from the children

Jan van Brügge

That signature should be (Fix f -> f (a, Fix g) -> Fix g) -> Fix f -> (a, Fix g)

Jan van Brügge

And now having looked at it more I see that this is just para :face_palm:

Jan van Brügge

And now that I am working with it, I notice that I do not even need the old structure, so cata does the job too