flix

0.67.0

BPlusTree

Definitions

def adjust(f: v -> v \ ef, k: k, t: BPlusTree[k, v, r]): Unit \ ef + r with Order[k] Source

Updates t with k => f(v) if k => v is in t.

Otherwise, t is unchanged.

Thread-safe.

def adjustWithKey(f: k -> (v -> v \ ef), k: k, t: BPlusTree[k, v, r]): Unit \ ef + r with Order[k] Source

Updates t with k => f(k, v) if k => v is in t.

Otherwise, t is unchanged.

Thread-safe.

def arity(t: BPlusTree[k, v, r]): Int32 Source

Returns the arity of t.

def computeIfAbsent(f: Unit -> v \ ef, k: k, t: BPlusTree[k, v, r]): v \ ef + r with Order[k] Source

Returns v if k => v is in t. Otherwise, computes v = f(), inserts k => v and returns v. That is, f is only evaluated if k is not in t.

This operation is atomic.

Thread-safe.

def empty(rc: Region[r]): BPlusTree[k, v, r] \ r Source

Returns a fresh empty BPlusTree tree of standard arity.

def emptyWithArity(rc: Region[r], m: Int32): BPlusTree[k, v, r] \ r Source

Returns a fresh empty BPlusTree tree with arity m (the maximum keys/values per node). The arity must be at least 3.

def exists(f: k -> (v -> Bool \ ef), t: BPlusTree[k, v, r]): Bool \ ef + r Source

Returns true if and only if there exists k => v in t such that f(k, v) == true.

Not thread-safe.

def find(f: k -> (v -> Bool \ ef), t: BPlusTree[k, v, r]): Option[(k, v)] \ ef + r Source

Alias for findLeft.

Not thread-safe.

def findLeft(f: k -> (v -> Bool \ ef), t: BPlusTree[k, v, r]): Option[(k, v)] \ ef + r Source

Optionally returns the first mapping in t satisfying the function f.

Not thread-safe.

def foldLeft(f: b -> (v -> b \ ef), i: b, t: BPlusTree[k, v, r]): b \ ef + r with Order[k] Source

Applies f to a start value i and all values in t going from left to right.

Not thread-safe.

def foldLeftWithKey(f: b -> (k -> (v -> b \ ef)), i: b, t: BPlusTree[k, v, r]): b \ ef + r with Order[k] Source

Applies f to a start value i and all mappings k => v in t going from left to right.

Not thread-safe.

def forAll(f: k -> (v -> Bool \ ef), t: BPlusTree[k, v, r]): Bool \ ef + r Source

Returns true if and only if for all k => v in t, f(k, v) == true.

Not thread-safe.

def forEach(f: k -> (v -> Unit \ ef), t: BPlusTree[k, v, r]): Unit \ ef + r Source

Applies f to all mappings k => v in t.

Not thread-safe.

def get(k: k, t: BPlusTree[k, v, r]): Option[v] \ r with Order[k] Source

Returns Some(v) if k => v is in t. Otherwise, returns None.

Thread-safe.

def getKeyAndValue(k: k, t: BPlusTree[k, v, r]): Option[(k, v)] \ r with Order[k] Source

Returns Some((k, v)) if k => v is in t. Otherwise, returns None.

Thread-safe.

def getWithDefault(k: k, d: v, t: BPlusTree[k, v, r]): v \ r with Order[k] Source

Returns v if k => v is in t. Otherwise, returns d.

Thread-safe.

def isEmpty(t: BPlusTree[k, v, r]): Bool \ r Source

Returns true if and only if t is the empty tree.

Thread-safe.

def iterator(rc1: Region[r1], t: BPlusTree[k, v, r]): Iterator[(k, v), r + r1, r1] \ r + r1 Source

Returns an iterator over all key-value pairs in t,

Not thread-safe.

def joinKeys(sep: String, t: BPlusTree[k, v, r]): String \ r with ToString[k] Source

Returns a string containing all keys in t, in key order, with each key formatted by its ToString instance and separated by sep.

Not thread-safe.

def joinValues(sep: String, t: BPlusTree[k, v, r]): String \ r with ToString[v] Source

Returns a string containing all values in t, in key order, with each value formatted by its ToString instance and separated by sep.

Not thread-safe.

def joinWith(f: k -> (v -> String \ ef), sep: String, t: BPlusTree[k, v, r]): String \ r + ef Source

Applies f to each key-value pair in t, in key order, to obtain a string and returns all results joined together using sep.

Not thread-safe.

def keysOf(t: BPlusTree[k, v, r]): Set[k] \ r with Order[k] Source

Returns the set of keys in t.

Not thread-safe.

def map(rc1: Region[r1], f: v1 -> v2 \ ef, t: BPlusTree[k, v1, r]): BPlusTree[k, v2, r1] \ ef + r + r1 with Order[k] Source

Returns a BPlusTree with mappings k => f(v) for every k => v in t.

Not thread-safe.

def mapWithKey(rc1: Region[r1], f: k -> (v1 -> v2 \ ef), t: BPlusTree[k, v1, r]): BPlusTree[k, v2, r1] \ ef + r + r1 with Order[k] Source

Returns a BPlusTree with mappings k => f(k, v) for every k => v in t.

Not thread-safe.

def memberOf(k: k, t: BPlusTree[k, v, r]): Bool \ r with Order[k] Source

Returns true if and only if t contains the key k.

Thread-safe.

def memberOfPair(k: k, v: v, t: BPlusTree[k, v, r]): Bool \ r with Order[k], Eq[v] Source

Returns true if and only if t contains the mapping k => v.

Thread-safe.

def merge(src: BPlusTree[k, v, r], dst: BPlusTree[k, v, r]): Unit \ r with Order[k] Source

Merge src into dst modyfing dst in a left-biased manner.

That is, key collisions are resolved by taking the mapping from src.

Not thread-safe.

def mergeWith(f: v -> (v -> v \ ef), src: BPlusTree[k, v, r], dst: BPlusTree[k, v, r]): Unit \ r + ef with Order[k] Source

Merges src into dst modyfing dst. If k => v1 is in src and k => v2 is in dst, updates dst to with k => f(v1, v2).

Not thread-safe.

def minimumKey(t: BPlusTree[k, v, r]): Option[(k, v)] \ r Source

Optionally returns k => v where k is the minimum key.

Not thread-safe.

def nonEmpty(t: BPlusTree[k, v, r]): Bool \ r Source

Returns true if and only if t contains at least one mapping.

Thread-safe.

def put(k: k, v: v, t: BPlusTree[k, v, r]): Unit \ r with Order[k] Source

Updates the tree t with the mapping k => v. Replaces any existing mapping.

Updates both the key and value of the mapping.

Thread-safe.

def putIf(decider: k -> (v -> (k -> (v -> Bool))), k: k, v: v, t: BPlusTree[k, v, r]): Unit \ r with Order[k] Source

Updates the tree t with the mapping k => v. Replaces any existing mapping, k2 => v2, if decider(k, v, k2, v2) == true.

Thread-safe and atomic.

def putWith(f: v -> (v -> v \ ef), k: k, v: v, t: BPlusTree[k, v, r]): Unit \ ef + r with Order[k] Source

Updates t with k => f(k, v, v1) if k => v1 is in t.

Otherwise, updates t with k => v.

Thread-safe.

def rangeQueryWith(f: k -> (v -> Unit \ ef), min: k, max: k, t: BPlusTree[k, v, r]): Unit \ r + ef with Order[k] Source

Applies f in ascending order to all mappings k => v in t where min <= k <= max.

Not thread-safe.

def toList(t: BPlusTree[k, v, r]): List[(k, v)] \ r Source

Returns a list of the key-value pairs in t. Elements are ordered from smallest (left) to largest (right).

Not thread-safe.

def toMap(t: BPlusTree[k, v, r]): Map[k, v] \ r with Order[k] Source

Returns t as an immutable map.

Not thread-safe.

def toSet(t: BPlusTree[k, v, r]): Set[(k, v)] \ r with Order[k], Order[v] Source

Returns t as a set of key-value pairs.

Not thread-safe.

def toString(t: BPlusTree[k, v, r]): String \ r with ToString[k], ToString[v] Source

Returns a string representation of t.

Not thread-safe.

def toVector(t: BPlusTree[k, v, r]): Vector[(k, v)] \ r Source

Returns t as a vector of key-value pairs.

Not thread-safe.

def valuesOf(t: BPlusTree[k, v, r]): List[v] \ r with Order[k] Source

Returns the list of values in t.

Not thread-safe.