Tree from nesting levels: Difference between revisions
m
→Functional
m (→Functional) |
|||
Line 126:
:# a generic ''forestFromNestLevels'' function to map from a normalised input list to a generic tree, and
:# a standard catamorphism over trees (''foldTree'') to generate both the nested list format, and the round-trip regeneration of a sparse list from the generic tree.
<lang applescript>----------------- FOREST FROM NEST LEVELS ----------------
-- forestFromNestLevels :: [(Int, a)] -> [Tree a]
|