pringletons-0.1.0.0: Classes and data structures complementing the singletons library

Safe HaskellNone
LanguageHaskell2010

Data.Singletons.Map

Description

This is a dependent version of the Data.Map module from containers.

This module was largely copied from the dependent-map package.

Synopsis

Documentation

data SingMap kproxy f where Source

Constructors

Tip :: SingMap kproxy f 
Bin :: !Int -> !(Sing v) -> !(f v) -> !(SingMap kproxy f) -> !(SingMap kproxy f) -> SingMap kproxy f 

Instances

(SEq k kproxy, SDecide k kproxy, EqSing1 k f) => Eq (SingMap k kproxy f) Source 
(ToJSONKeyKind k kproxy, ToJSONSing1 k f) => ToJSON (SingMap k kproxy f) Source 
(SOrd k kproxy, SDecide k kproxy, FromJSONKeyKind k kproxy, FromJSONSing1 k f) => FromJSON (SingMap k kproxy f) Source 
(HashableKind k kproxy, HashableSing1 k f) => Hashable (SingMap k kproxy f) Source 

empty :: SingMap kproxy f Source

O(1). The empty map.

empty      == fromList []
size empty == 0

singleton :: Sing v -> f v -> SingMap kproxy f Source

O(1). A map with a single element.

singleton 1 'a'        == fromList [(1, 'a')]
size (singleton 1 'a') == 1

null :: SingMap kproxy f -> Bool Source

O(1). Is the map empty?

size :: SingMap kproxy f -> Int Source

O(1). The number of elements in the map.

lookup :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> Maybe (f v) Source

O(log n). Lookup the value at a key in the map.

The function will return the corresponding value as (Just value), or Nothing if the key isn't in the map.

lookupAssoc :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => SomeSing kproxy -> SingMap kproxy f -> Maybe (SomeSingWith1 kproxy f) Source

combine :: (SOrd kproxy, SDecide kproxy) => Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

insertMax :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f Source

insertMin :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f Source

merge :: SOrd kproxy => SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

glue :: (kproxy ~ KProxy) => SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

deleteFindMin :: (kproxy ~ KProxy) => SingMap kproxy f -> (SomeSingWith1 kproxy f, SingMap kproxy f) Source

O(log n). Delete and find the minimal element.

deleteFindMin (fromList [(5,"a"), (3,"b"), (10,"c")]) == ((3,"b"), fromList[(5,"a"), (10,"c")]) 
deleteFindMin                                            Error: can not return the minimal element of an empty map

deleteFindMax :: (kproxy ~ KProxy) => SingMap kproxy f -> (SomeSingWith1 kproxy f, SingMap kproxy f) Source

O(log n). Delete and find the maximal element.

deleteFindMax (fromList [(5,"a"), (3,"b"), (10,"c")]) == ((10,"c"), fromList [(3,"b"), (5,"a")])
deleteFindMax empty                                      Error: can not return the maximal element of an empty map

balance :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

rotateL :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

rotateR :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

singleL :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

singleR :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

doubleL :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

doubleR :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

bin :: Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

trim :: SOrd kproxy => (SomeSing kproxy -> Ordering) -> (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> SingMap kproxy f Source

trimLookupLo :: (SOrd kproxy, SDecide kproxy) => SomeSing kproxy -> (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> (Maybe (SomeSingWith1 kproxy f), SingMap kproxy f) Source

filterGt :: (SOrd kproxy, SDecide kproxy) => (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> SingMap kproxy f Source

filterLt :: (SOrd kproxy, SDecide kproxy) => (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> SingMap kproxy f Source

(!) :: (SOrd kproxy, SDecide kproxy) => SingMap kproxy f -> Sing v -> f v infixl 9 Source

O(log n). Find the value at a key. Calls error when the element can not be found.

fromList [(5,'a'), (3,'b')] ! 1    Error: element not in the map
fromList [(5,'a'), (3,'b')] ! 5 == 'a'

(\\) :: (SOrd kproxy, SDecide kproxy) => SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f infixl 9 Source

Same as difference.

member :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> Bool Source

O(log n). Is the key a member of the map? See also notMember.

notMember :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> Bool Source

O(log n). Is the key not a member of the map? See also member.

find :: (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> f v Source

O(log n). Find the value at a key. Calls error when the element can not be found. Consider using lookup when elements may not be present.

findWithDefault :: (SOrd kproxy, SDecide kproxy) => f v -> Sing v -> SingMap kproxy f -> f v Source

O(log n). The expression (findWithDefault def k map) returns the value at key k or returns default value def when the key is not in the map.

insert :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Insert a new key and value in the map. If the key is already present in the map, the associated value is replaced with the supplied value. insert is equivalent to insertWith const.

insertWith :: (SOrd kproxy, SDecide kproxy) => (f v -> f v -> f v) -> Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Insert with a function, combining new value and old value. insertWith f key value mp will insert the entry key :=> value into mp if key does not exist in the map. If the key does exist, the function will insert the entry key :=> f new_value old_value.

insertWith' :: (SOrd kproxy, SDecide kproxy) => (f v -> f v -> f v) -> Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f Source

Same as insertWith, but the combining function is applied strictly. This is often the most desirable behavior.

insertWithKey :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => (Sing v -> f v -> f v -> f v) -> Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Insert with a function, combining key, new value and old value. insertWithKey f key value mp will insert the entry key :=> value into mp if key does not exist in the map. If the key does exist, the function will insert the entry key :=> f key new_value old_value. Note that the key passed to f is the same key passed to insertWithKey.

insertWithKey' :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => (Sing v -> f v -> f v -> f v) -> Sing v -> f v -> SingMap kproxy f -> SingMap kproxy f Source

Same as insertWithKey, but the combining function is applied strictly.

insertLookupWithKey :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => (Sing v -> f v -> f v -> f v) -> Sing v -> f v -> SingMap kproxy f -> (Maybe (f v), SingMap kproxy f) Source

O(log n). Combines insert operation with old value retrieval. The expression (insertLookupWithKey f k x map) is a pair where the first element is equal to (lookup k map) and the second element equal to (insertWithKey f k x map).

insertLookupWithKey' :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => (Sing v -> f v -> f v -> f v) -> Sing v -> f v -> SingMap kproxy f -> (Maybe (f v), SingMap kproxy f) Source

O(log n). A strict version of insertLookupWithKey.

delete :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Delete a key and its value from the map. When the key is not a member of the map, the original map is returned.

adjust :: (SOrd kproxy, SDecide kproxy) => (f v -> f v) -> Sing v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Update a value at a specific key with the result of the provided function. When the key is not a member of the map, the original map is returned.

adjustWithKey :: (SOrd kproxy, SDecide kproxy) => (Sing v -> f v -> f v) -> Sing v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.

update :: (SOrd kproxy, SDecide kproxy) => (f v -> Maybe (f v)) -> Sing v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). The expression (update f k map) updates the value x at k (if it is in the map). If (f x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y.

updateWithKey :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => (Sing v -> f v -> Maybe (f v)) -> Sing v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). The expression (updateWithKey f k map) updates the value x at k (if it is in the map). If (f k x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y.

updateLookupWithKey :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => (Sing v -> f v -> Maybe (f v)) -> Sing v -> SingMap kproxy f -> (Maybe (f v), SingMap kproxy f) Source

O(log n). Lookup and update. See also updateWithKey. The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted.

alter :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => (Maybe (f v) -> Maybe (f v)) -> Sing v -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). The expression (alter f k map) alters the value x at k, or absence thereof. alter can be used to insert, delete, or update a value in a Map. In short : lookup k (alter f k m) = f (lookup k m).

findIndex :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> Int Source

O(log n). Return the index of a key. The index is a number from 0 up to, but not including, the size of the map. Calls error when the key is not a member of the map.

lookupIndex :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> Maybe Int Source

O(log n). Lookup the index of a key. The index is a number from 0 up to, but not including, the size of the map.

elemAt :: (kproxy ~ KProxy) => Int -> SingMap kproxy f -> SomeSingWith1 kproxy f Source

O(log n). Retrieve an element by index. Calls error when an invalid index is used.

updateAt :: (kproxy ~ KProxy) => (forall v. Sing v -> f v -> Maybe (f v)) -> Int -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Update the element at index. Calls error when an invalid index is used.

deleteAt :: (kproxy ~ KProxy) => Int -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Delete the element at index. Defined as (deleteAt i map = updateAt (k x -> Nothing) i map).

findMin :: (kproxy ~ KProxy) => SingMap kproxy f -> SomeSingWith1 kproxy f Source

O(log n). The minimal key of the map. Calls error is the map is empty.

findMax :: (kproxy ~ KProxy) => SingMap kproxy f -> SomeSingWith1 kproxy f Source

O(log n). The maximal key of the map. Calls error is the map is empty.

deleteMin :: (kproxy ~ KProxy) => SingMap kproxy f -> SingMap kproxy f Source

O(log n). Delete the minimal key. Returns an empty map if the map is empty.

deleteMax :: (kproxy ~ KProxy) => SingMap kproxy f -> SingMap kproxy f Source

O(log n). Delete the maximal key. Returns an empty map if the map is empty.

updateMinWithKey :: (forall v. Sing v -> f v -> Maybe (f v)) -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Update the value at the minimal key.

updateMaxWithKey :: (forall v. Sing v -> f v -> Maybe (f v)) -> SingMap kproxy f -> SingMap kproxy f Source

O(log n). Update the value at the maximal key.

minViewWithKey :: (kproxy ~ KProxy) => SingMap kproxy f -> Maybe (SomeSingWith1 kproxy f, SingMap kproxy f) Source

O(log n). Retrieves the minimal (key :=> value) entry of the map, and the map stripped of that element, or Nothing if passed an empty map.

maxViewWithKey :: (kproxy ~ KProxy) => SingMap kproxy f -> Maybe (SomeSingWith1 kproxy f, SingMap kproxy f) Source

O(log n). Retrieves the maximal (key :=> value) entry of the map, and the map stripped of that element, or Nothing if passed an empty map.

unions :: (SOrd kproxy, SDecide kproxy) => [SingMap kproxy f] -> SingMap kproxy f Source

The union of a list of maps: (unions == foldl union empty).

unionsWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> f v -> f v) -> [SingMap kproxy f] -> SingMap kproxy f Source

The union of a list of maps, with a combining operation: (unionsWithKey f == foldl (unionWithKey f) empty).

union :: (SOrd kproxy, SDecide kproxy) => SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

O(n+m). The expression (union t1 t2) takes the left-biased union of t1 and t2. It prefers t1 when duplicate keys are encountered, i.e. (union == unionWith const). The implementation uses the efficient hedge-union algorithm. Hedge-union is more efficient on (bigset `union` smallset).

hedgeUnionL :: (SOrd kproxy, SDecide kproxy) => (SomeSing kproxy -> Ordering) -> (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

unionWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> f v -> f v) -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

O(n+m). Union with a combining function. The implementation uses the efficient hedge-union algorithm. Hedge-union is more efficient on (bigset `union` smallset).

hedgeUnionWithKey :: forall kproxy f. (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> f v -> f v) -> (SomeSing kproxy -> Ordering) -> (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

difference :: (SOrd kproxy, SDecide kproxy) => SingMap kproxy f -> SingMap kproxy g -> SingMap kproxy f Source

O(n+m). Difference of two maps. Return elements of the first map not existing in the second map. The implementation uses an efficient hedge algorithm comparable with hedge-union.

hedgeDiff :: (SOrd kproxy, SDecide kproxy) => (SomeSing kproxy -> Ordering) -> (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> SingMap kproxy g -> SingMap kproxy f Source

differenceWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> g v -> Maybe (f v)) -> SingMap kproxy f -> SingMap kproxy g -> SingMap kproxy f Source

O(n+m). Difference with a combining function. When two equal keys are encountered, the combining function is applied to the key and both values. If it returns Nothing, the element is discarded (proper set difference). If it returns (Just y), the element is updated with a new value y. The implementation uses an efficient hedge algorithm comparable with hedge-union.

hedgeDiffWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> g v -> Maybe (f v)) -> (SomeSing kproxy -> Ordering) -> (SomeSing kproxy -> Ordering) -> SingMap kproxy f -> SingMap kproxy g -> SingMap kproxy f Source

intersection :: (SOrd kproxy, SDecide kproxy) => SingMap kproxy f -> SingMap kproxy f -> SingMap kproxy f Source

O(n+m). Intersection of two maps. Return data in the first map for the keys existing in both maps. (intersection m1 m2 == intersectionWith const m1 m2).

intersectionWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> g v -> h v) -> SingMap kproxy f -> SingMap kproxy g -> SingMap kproxy h Source

O(n+m). Intersection with a combining function. Intersection is more efficient on (bigset `intersection` smallset).

filterWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> Bool) -> SingMap kproxy f -> SingMap kproxy f Source

O(n). Filter all keys/values that satisfy the predicate.

partitionWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> Bool) -> SingMap kproxy f -> (SingMap kproxy f, SingMap kproxy f) Source

O(n). Partition the map according to a predicate. The first map contains all elements that satisfy the predicate, the second all elements that fail the predicate. See also split.

mapMaybeWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> Maybe (g v)) -> SingMap kproxy f -> SingMap kproxy g Source

O(n). Map keys/values and collect the Just results.

mapEitherWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> Either (g v) (h v)) -> SingMap kproxy f -> (SingMap kproxy g, SingMap kproxy h) Source

O(n). Map keys/values and separate the Left and Right results.

mapWithKey :: (forall v. Sing v -> f v -> g v) -> SingMap kproxy f -> SingMap kproxy g Source

O(n). Map a function over all values in the map.

mapAccumLWithKey :: (forall v. a -> Sing v -> f v -> (a, g v)) -> a -> SingMap kproxy f -> (a, SingMap kproxy g) Source

O(n). The function mapAccumLWithKey threads an accumulating argument throught the map in ascending order of keys.

mapAccumRWithKey :: (forall v. a -> Sing v -> f v -> (a, g v)) -> a -> SingMap kproxy f -> (a, SingMap kproxy g) Source

O(n). The function mapAccumRWithKey threads an accumulating argument through the map in descending order of keys.

foldWithKey :: (forall v. Sing v -> f v -> b -> b) -> b -> SingMap kproxy f -> b Source

Deprecated: Use foldrWithKey instead

O(n*log n). mapKeysWith c f s is the map obtained by applying f to each key of s.

The size of the result may be smaller if f maps two or more distinct keys to the same new key. In this case the associated values will be combined using c. mapKeysWith :: (SOrd kproxy2, SDecide kproxy2) => (forall v. Sing v -> f v -> f v -> f v) -> (forall v. Sing v -> Sing v) -> SingMap kproxy1 f -> SingMap kproxy2 f mapKeysWith c f = fromListWithKey c . map fFirst . toList where fFirst (SomeSingWith1 x y) = (SomeSingWith1 (f x) y)

O(n). mapKeysMonotonic f s == mapKeys f s, but works only when f is strictly monotonic. That is, for any values x and y, if x < y then f x < f y. The precondition is not checked. Semi-formally, we have:

and [x < y ==> f x < f y | x <- ls, y <- ls] 
                    ==> mapKeysMonotonic f s == mapKeys f s
    where ls = keys s

This means that f maps distinct original keys to distinct resulting keys. This function has better performance than mapKeys. mapKeysMonotonic :: forall (kproxy1 :: KProxy k) kproxy2 f. (forall (v :: k). Sing v -> Sing v) -> SingMap kproxy1 f -> SingMap kproxy2 f mapKeysMonotonic _ Tip = Tip mapKeysMonotonic f (Bin sz k x l r) = Bin sz (f k) x (mapKeysMonotonic f l) (mapKeysMonotonic f r)

O(n). Fold the keys and values in the map, such that foldWithKey f z == foldr (uncurry f) z . toAscList.

This is identical to foldrWithKey, and you should use that one instead of this one. This name is kept for backward compatibility.

foldrWithKey :: (forall v. Sing v -> f v -> b -> b) -> b -> SingMap kproxy f -> b Source

O(n). Post-order fold. The function will be applied from the lowest value to the highest.

foldlWithKey :: (forall v. b -> Sing v -> f v -> b) -> b -> SingMap kproxy f -> b Source

O(n). Pre-order fold. The function will be applied from the highest value to the lowest.

keys :: (kproxy ~ KProxy) => SingMap kproxy f -> [SomeSing kproxy] Source

O(n). Return all keys of the map in ascending order.

keys (fromList [(5,"a"), (3,"b")]) == [3,5]
keys empty == []

assocs :: (kproxy ~ KProxy) => SingMap kproxy f -> [SomeSingWith1 kproxy f] Source

O(n). Return all key/value pairs in the map in ascending key order.

fromList :: (SOrd kproxy, SDecide kproxy) => [SomeSingWith1 kproxy f] -> SingMap kproxy f Source

O(n*log n). Build a map from a list of key/value pairs. See also fromAscList. If the list contains more than one value for the same key, the last value for the key is retained.

fromListWithKey :: (SOrd kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> f v -> f v) -> [SomeSingWith1 kproxy f] -> SingMap kproxy f Source

O(n*log n). Build a map from a list of key/value pairs with a combining function. See also fromAscListWithKey.

toList :: (kproxy ~ KProxy) => SingMap kproxy f -> [SomeSingWith1 kproxy f] Source

O(n). Convert to a list of key/value pairs.

toAscList :: (kproxy ~ KProxy) => SingMap kproxy f -> [SomeSingWith1 kproxy f] Source

O(n). Convert to an ascending list.

toDescList :: (kproxy ~ KProxy) => SingMap kproxy f -> [SomeSingWith1 kproxy f] Source

O(n). Convert to a descending list.

fromAscList :: (SEq kproxy, SDecide kproxy) => [SomeSingWith1 kproxy f] -> SingMap kproxy f Source

O(n). Build a map from an ascending list in linear time. The precondition (input list is ascending) is not checked.

fromAscListWithKey :: (SEq kproxy, SDecide kproxy) => (forall v. Sing v -> f v -> f v -> f v) -> [SomeSingWith1 kproxy f] -> SingMap kproxy f Source

O(n). Build a map from an ascending list in linear time with a combining function for equal keys. The precondition (input list is ascending) is not checked.

fromDistinctAscList :: [SomeSingWith1 kproxy f] -> SingMap kproxy f Source

O(n). Build a map from an ascending list of distinct elements in linear time. The precondition is not checked.

split :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> (SingMap kproxy f, SingMap kproxy f) Source

O(log n). The expression (split k map) is a pair (map1,map2) where the keys in map1 are smaller than k and the keys in map2 larger than k. Any key equal to k is found in neither map1 nor map2.

splitLookup :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> (SingMap kproxy f, Maybe (f v), SingMap kproxy f) Source

O(log n). The expression (splitLookup k map) splits a map just like split but also returns lookup k map.

splitLookupWithKey :: forall kproxy f v. (SOrd kproxy, SDecide kproxy) => Sing v -> SingMap kproxy f -> (SingMap kproxy f, Maybe (Sing v, f v), SingMap kproxy f) Source

O(log n).

showTreeWith :: (forall v. Sing v -> f v -> String) -> Bool -> Bool -> SingMap kproxy f -> String Source

O(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.

showsTree :: (forall v. Sing v -> f v -> String) -> Bool -> [String] -> [String] -> SingMap kproxy f -> ShowS Source

showsTreeHang :: (forall v. Sing v -> f v -> String) -> Bool -> [String] -> SingMap kproxy f -> ShowS Source

valid :: (SOrd kproxy, SDecide kproxy) => SingMap kproxy f -> Bool Source

O(n). Test if the internal map structure is valid.

ordered :: (SOrd kproxy, SDecide kproxy) => SingMap kproxy f -> Bool Source

balanced :: SingMap kproxy f -> Bool Source

Exported only for Debug.QuickCheck

validsize :: SingMap kproxy f -> Bool Source

foldlStrict :: (a -> b -> a) -> a -> [b] -> a Source

compareSome :: SOrd kproxy => SomeSing kproxy -> SomeSing kproxy -> Ordering Source

ltSome :: SOrd kproxy => SomeSing kproxy -> SomeSing kproxy -> Bool Source

gtSome :: SOrd kproxy => SomeSing kproxy -> SomeSing kproxy -> Bool Source

unifyOnCompareEQ :: forall kproxy a b x. (SDecide kproxy, Compare a b ~ EQ) => Sing a -> Sing b -> ((a ~ b) => x) -> x Source

unifyOnEq :: forall kproxy a b x. (SDecide kproxy, (a :== b) ~ True) => Sing a -> Sing b -> ((a ~ b) => x) -> x Source