Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
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)
(f a -> (a, f b)) -> Fix f -> (a, Fix f)
ie a bottom up traversal like cata, but returning a new tree using the info from the children
That signature should be (Fix f -> f (a, Fix g) -> Fix g) -> Fix f -> (a, Fix g)
(Fix f -> f (a, Fix g) -> Fix g) -> Fix f -> (a, Fix g)
And now having looked at it more I see that this is just para :face_palm:
para
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
cata
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)
ie a bottom up traversal like cata, but returning a new tree using the info from the children
That signature should be
(Fix f -> f (a, Fix g) -> Fix g) -> Fix f -> (a, Fix g)
And now having looked at it more I see that this is just
para
:face_palm: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