Visualize a tree: Difference between revisions
m
→{{header|Haskell}}
(→{{header|Haskell}}: Added a version using Data.Tree `drawTree`) |
|||
Line 978:
The '''Data.Tree''' module in the standard (GHC) libraries also includes a '''drawTree''' function for multiway (rose) trees of strings.
We can ''fmap show'' over our tree of integers to derive a tree of strings, and apply `drawTree` to that.
<lang haskell>import Data.Tree (Tree (..), drawTree)
|