
29 Sep
2009
29 Sep
'09
1:02 p.m.
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