Low-level implementation of the size-bounded tree #
This file contains the basic definition implementing the functionality of the size-bounded trees.
Modification operations #
An empty tree.
Instances For
Slower version of containsThenInsert which can be used in the absence of balance
information but still assumes the preconditions of containsThenInsert, otherwise might panic.
Instances For
Slower version of insertIfNew which can be used in the absence of balance
information but still assumes the preconditions of insertIfNew, otherwise might panic.
Instances For
Returns the pair (t.contains k, t.insertIfNew k v).
Instances For
Slower version of containsThenInsertIfNew which can be used in the absence of balance
information but still assumes the preconditions of containsThenInsertIfNew, otherwise might panic.
Instances For
Slower version of getThenInsertIfNew? which can be used in the absence of balance
information but still assumes the preconditions of getThenInsertIfNew?, otherwise might panic.
Instances For
Slower version of eraseMany which can be used in absence of balance information but still
assumes the preconditions of eraseMany, otherwise might panic.
Instances For
Slower version of eraseManyEntries which can be used in absence of balance information but still
assumes the preconditions of eraseManyEntries, otherwise might panic.
Instances For
Computes the union of the given tree maps. If a key appears in both maps, the entry contained in the second argument will appear in the result.
This function always merges the smaller map into the larger map.
Instances For
Slower version of insertMany which can be used in absence of balance information but still
assumes the preconditions of insertMany, otherwise might panic.
Instances For
Slower version of insertManyIfNew which can be used in absence of balance information but still
assumes the preconditions of insertManyIfNew, otherwise might panic.
Instances For
Slower version of insertMany which can be used in absence of balance information but still
assumes the preconditions of insertMany, otherwise might panic.
Instances For
Slower version of insertManyIfNewUnit which can be used in absence of balance information but still
assumes the preconditions of insertManyIfNewUnit, otherwise might panic.
Instances For
Transforms an element of SizedBalancedTree into a BalancedTree.
Instances For
Slower version of getThenInsertIfNew? which can be used in the absence of balance
information but still assumes the preconditions of getThenInsertIfNew?, otherwise might panic.
Instances For
Returns the tree consisting of the mappings (k, (f k v).get) where (k, v) was a mapping in
the original tree and (f k v).isSome.
Instances For
Slower version of filterMap which can be used in the absence of balance
information but still assumes the preconditions of filterMap, otherwise might panic.
Instances For
Monadic version of map.
Instances For
Returns the tree consisting of the mapping (k, v) where (k, v) was a mapping in the
original tree and f k v = true.
Instances For
Slower version of filter which can be used in the absence of balance
information but still assumes the preconditions of filter, otherwise might panic.
Instances For
Internal implementation detail of the tree map
Instances For
Changes the mapping of the key k by applying the function f to the current mapped value
(if any). This function can be used to insert a new mapping, modify an existing one or delete it.
This version of the function requires LawfulEqOrd α. There is an alternative non-dependent version
called Const.alter.
Instances For
Slower version of modify which can be used in the absence of balance
information but still assumes the preconditions of modify, otherwise might panic.
Instances For
Internal implementation detail of the tree map
Instances For
Returns a map that contains all mappings of t₁ and t₂. In case that both maps contain the
same key k with respect to cmp, the provided function is used to determine the new value from
the respective values in t₁ and t₂.
Instances For
Returns a map that contains all mappings of t₁ and t₂. In case that both maps contain the
same key k with respect to cmp, the provided function is used to determine the new value from
the respective values in t₁ and t₂.
Instances For
Changes the mapping of the key k by applying the function f to the current mapped value
(if any). This function can be used to insert a new mapping, modify an existing one or delete it.
This version of the function requires LawfulEqOrd α. There is an alternative non-dependent version
called Const.alter.
Instances For
Slower version of modify which can be used in the absence of balance
information but still assumes the preconditions of modify, otherwise might panic.
Instances For
Returns a map that contains all mappings of t₁ and t₂. In case that both maps contain the
same key k with respect to cmp, the provided function is used to determine the new value from
the respective values in t₁ and t₂.
Instances For
Returns a map that contains all mappings of t₁ and t₂. In case that both maps contain the
same key k with respect to cmp, the provided function is used to determine the new value from
the respective values in t₁ and t₂.