Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module exposes internal representation of TMap
.
TMap has one invariant condition:
- Subtrees of an
TMap
should not be empty.
For example, consider following tree structure which is valid:
> fromList [("a",1), ("aa", 2), ("bc", 3)] Root 'a' -> 1 'a' -> 2 'b' -> 'c' -> 3
Adding redundant node which represents empty map does not change
what an TMap
represents.
Root 'a' -> 1 'a' -> 2 'b' -> 'c' -> 3 'd' -> 'e' -> 'f' ->
But such TMap
should not exist because it confuses Eq
and Ord
instances and null
function.
Types
Mapping from [c]
to a
implemented as a trie.
This type serves almost same purpose with Map [c] a
,
but can be looked up more efficiently.
Instances
Functor (TMap c) Source # | |
Foldable (TMap c) Source # | |
Defined in Data.Trie.Map.Hidden fold :: Monoid m => TMap c m -> m # foldMap :: Monoid m => (a -> m) -> TMap c a -> m # foldr :: (a -> b -> b) -> b -> TMap c a -> b # foldr' :: (a -> b -> b) -> b -> TMap c a -> b # foldl :: (b -> a -> b) -> b -> TMap c a -> b # foldl' :: (b -> a -> b) -> b -> TMap c a -> b # foldr1 :: (a -> a -> a) -> TMap c a -> a # foldl1 :: (a -> a -> a) -> TMap c a -> a # elem :: Eq a => a -> TMap c a -> Bool # maximum :: Ord a => TMap c a -> a # minimum :: Ord a => TMap c a -> a # | |
Traversable (TMap c) Source # | |
(Eq a, Eq c) => Eq (TMap c a) Source # | |
(Ord a, Ord c) => Ord (TMap c a) Source # | |
Defined in Data.Trie.Map.Hidden | |
(Show c, Show a) => Show (TMap c a) Source # | |
(Ord c, Semigroup a) => Semigroup (TMap c a) Source # |
|
(Ord c, Semigroup a) => Monoid (TMap c a) Source # |
|
(NFData c, NFData a) => NFData (TMap c a) Source # | |
Defined in Data.Trie.Map.Hidden |
Instances
Functor (Node c a) Source # | |
Foldable (Node c a) Source # | |
Defined in Data.Trie.Map.Hidden fold :: Monoid m => Node c a m -> m # foldMap :: Monoid m => (a0 -> m) -> Node c a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Node c a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Node c a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Node c a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Node c a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Node c a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Node c a a0 -> a0 # toList :: Node c a a0 -> [a0] # length :: Node c a a0 -> Int # elem :: Eq a0 => a0 -> Node c a a0 -> Bool # maximum :: Ord a0 => Node c a a0 -> a0 # minimum :: Ord a0 => Node c a a0 -> a0 # | |
Traversable (Node c a) Source # | |
(Eq a, Eq c, Eq r) => Eq (Node c a r) Source # | |
(Ord a, Ord c, Ord r) => Ord (Node c a r) Source # | |
(Show a, Show c, Show r) => Show (Node c a r) Source # | |
(NFData c, NFData a, NFData r) => NFData (Node c a r) Source # | |
Defined in Data.Trie.Map.Hidden |