The expression (
showTreeWith showelem hang
wide map) shows the tree that implements the map. Elements are
shown using the
showElem function. If
hang is
True, a
hanging tree is shown otherwise a rotated tree
is shown. If
wide is
True, an extra wide version is
shown.
Map> let t = fromDistinctAscList [(x,()) | x <- [1..5]]
Map> putStrLn $ showTreeWith (\k x -> show (k,x)) True False t
(4,())
+--(2,())
| +--(1,())
| +--(3,())
+--(5,())
Map> putStrLn $ showTreeWith (\k x -> show (k,x)) True True t
(4,())
|
+--(2,())
| |
| +--(1,())
| |
| +--(3,())
|
+--(5,())
Map> putStrLn $ showTreeWith (\k x -> show (k,x)) False True t
+--(5,())
|
(4,())
|
| +--(3,())
| |
+--(2,())
|
+--(1,())