O(n \log n). Show the tree that implements the map. The tree is shown
in a compressed, hanging format. See showTreeWith.
Modulecontainers-0.7Haskell2010
Data.Map.Internal.Debug
- 13 values
- Packagecontainers-0.7
- Exports13
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceDebug.hs
O(n \log n). 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,())O(n). Test if the internal map structure is valid.
valid (fromAscList [(3,"b"), (5,"a")]) == True
valid (fromAscList [(5,"a"), (3,"b")]) == FalseTest if the keys are ordered correctly.
Test if a map obeys the balance invariants.
Test if each node of a map reports its size correctly.