record SortedMap : Type -> Type -> Type
- Totality: total
Visibility: export
Constructor: M : SortedDMap k (const v) -> SortedMap k v
Projection: .unM : SortedMap k v -> SortedDMap k (const v)
Hints:
Cast (SortedDMap k (const v)) (SortedMap k v)
Cast (SortedMap k v) (SortedDMap k (const v))
(Eq k, Eq v) => Eq (SortedMap k v)
Foldable (SortedMap k)
Functor (SortedMap k)
(Ord k, Semigroup v) => Monoid (SortedMap k v)
Semigroup v => Semigroup (SortedMap k v)
(Show k, Show v) => Show (SortedMap k v)
Traversable (SortedMap k)
Ord k => Zippable (SortedMap k)
empty : Ord k => SortedMap k v
- Visibility: export
lookup : k -> SortedMap k v -> Maybe v
- Visibility: export
insert : k -> v -> SortedMap k v -> SortedMap k v
- Visibility: export
singleton : Ord k => k -> v -> SortedMap k v
- Visibility: export
insertFrom : Foldable f => f (k, v) -> SortedMap k v -> SortedMap k v
- Visibility: export
delete : k -> SortedMap k v -> SortedMap k v
- Visibility: export
update : (Maybe v -> Maybe v) -> k -> SortedMap k v -> SortedMap k v
Updates or deletes a value based on the decision function
The decision function takes information about the presence of the value,
and the value itself, if it is present.
It returns a new value or the fact that there should be no value as the result.
The current implementation performs up to two traversals of the original map
Visibility: exportupdateExisting : (v -> v) -> k -> SortedMap k v -> SortedMap k v
Updates existing value, if it is present, and does nothing otherwise
The current implementation performs up to two traversals of the original map
Visibility: exportfromList : Ord k => List (k, v) -> SortedMap k v
- Visibility: export
toList : SortedMap k v -> List (k, v)
- Visibility: export
keys : SortedMap k v -> List k
Gets the keys of the map.
Visibility: exportvalues : SortedMap k v -> List v
Gets the values of the map. Could contain duplicates.
Visibility: exportmergeWith : (v -> v -> v) -> SortedMap k v -> SortedMap k v -> SortedMap k v
Merge two maps. When encountering duplicate keys, using a function to combine the values.
Uses the ordering of the first map given.
Visibility: exportmerge : Semigroup v => SortedMap k v -> SortedMap k v -> SortedMap k v
Merge two maps using the Semigroup (and by extension, Monoid) operation.
Uses mergeWith internally, so the ordering of the left map is kept.
Visibility: exportmergeLeft : SortedMap k v -> SortedMap k v -> SortedMap k v
Left-biased merge, also keeps the ordering specified by the left map.
Visibility: exportlookupBetween : key -> SortedMap key val -> (Maybe (key, val), Maybe (key, val))
looks up a key in map, returning the left and right closest values, so that
k1 <= k < k2. If at the end of the beginning and/or end of the sorted map, returns
nothing appropriately
Visibility: exportleftMost : SortedMap key val -> Maybe (key, val)
Returns the leftmost (least) key and value
Visibility: exportrightMost : SortedMap key val -> Maybe (key, val)
Returns the rightmost (greatest) key and value
Visibility: export