Can you identify this recursion pattern please?

This looks like some kind of unfold to me. Can you help? I have the following code that works for the first two levels: -- get the list of all (recursive) child gallery names -- first, just the immediate children childNames <- childGalleries db (name gallery) -- now let's try the next level grandchildren <- mapM (childGalleries db) childNames mapM putStrLn (childNames ++ concat grandchildren) The database query childGalleries gives me a list of all the immediate children. So what I want is recursively, the names of all the descendants, as well as the original name, concatenated to a flat list. I'm struggling to identify the higher-order recursion function I need. -- Colin Adams Preston Lancashire

"Colin" == Colin Paul Adams
writes:
Colin> The database query childGalleries gives me a list of all Colin> the immediate children. So what I want is recursively, the Colin> names of all the descendants, as well as the original name, Colin> concatenated to a flat list. I'm struggling to identify the Colin> higher-order recursion function I need. I worked out that Data.Tree.unfoldM_BF was what I needed. -- Colin Adams Preston Lancashire
participants (1)
-
Colin Paul Adams