Tree from nesting levels: Difference between revisions
Content added Content deleted
(→Applescript :: functional: Added a functional draft in AppleScript) |
|||
Line 124: | Line 124: | ||
===Functional=== |
===Functional=== |
||
Mapping from the sparse list format to a generic tree structure, and using both: |
Mapping from the sparse list format to a generic tree structure, and using both: |
||
:# a generic |
:# 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. |
:# 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> |
<lang applescript> |