DelayMap

0.40.0

Definitions

@Experimental@LazyWhenPure

def adjust [vefk] ( f : v -> v \ ef k : k m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Updates m with k => f(v) if k => v is in m. Otherwise, returns m.

Purity reflective: Applies f lazily if f is pure.

@Experimental@LazyWhenPure

def adjustWithKey [kvef] ( f : k -> (v -> v \ ef) k : k m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Updates m with k => f(k, v) if k => v is in m. Otherwise, returns m.

Purity reflective: Applies f lazily if f is pure.

@Experimental@ParallelWhenPure

def count [kvef] ( f : k -> (v -> Bool \ ef) m : DelayMap[k, v] ) : Int32 \ ef

Source

Returns the number of mappings k => v in m that satisfy the predicate f.

Purity reflective: Runs in parallel when given a pure function f.

@Experimental

def empty [kv] : DelayMap[k, v] \ Pure

Source

Returns the empty map.

@Experimental

def filter [vefk] ( f : v -> Bool \ ef m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Returns a map of all mappings k => v in m where v satisfies the predicate f.

@Experimental

def filterWithKey [kvef] ( f : k -> (v -> Bool \ ef) m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Returns a map of all mappings k => v in m where (k, v) satisfies the predicate f.

@Experimental

def foldLeft [bvefk] ( f : b -> (v -> b \ ef) s : b m : DelayMap[k, v] ) : b \ ef

Source

Applies f to a start value s and all values in m going from left to right.

That is, the result is of the form: f(...f(f(s, v1), v2)..., vn).

@Experimental

def foldLeftWithKey [bkvef] ( f : b -> (k -> (v -> b \ ef)) s : b m : DelayMap[k, v] ) : b \ ef

Source

Applies f to a start value s and all key-value pairs in m going from left to right.

That is, the result is of the form: f(...f(f(s, k1, v1), k2, v2)..., vn).

@Experimental

def foldRight [vbefk] ( f : v -> (b -> b \ ef) s : b m : DelayMap[k, v] ) : b \ ef

Source

Applies f to a start value s and all values in m going from right to left.

That is, the result is of the form: f(v1, ...f(vn-1, f(vn, s))).

@Experimental

def foldRightWithCont [vefbk] ( f : v -> ((Unit -> b \ ef) -> b \ ef) z : b m : DelayMap[k, v] ) : b \ ef

Source

Applies f to a start value z and all values in m going from right to left.

That is, the result is of the form: f(v1, ...f(vn-1, f(vn, z))). A foldRightWithCont allows early termination by not calling the continuation.

@Experimental

def foldRightWithKey [kvbef] ( f : k -> (v -> (b -> b \ ef)) s : b m : DelayMap[k, v] ) : b \ ef

Source

Applies f to a start value s and all key-value pairs in m going from right to left.

That is, the result is of the form: f(k1, v1, ...f(kn-1, vn-1, f(kn, vn, s))).

@Experimental

def foldRightWithKeyCont [kvefb] ( f : k -> (v -> ((Unit -> b \ ef) -> b \ ef)) s : b m : DelayMap[k, v] ) : b \ ef

Source

Applies f to a start value s and all key-value pairs in m going from right to left.

That is, the result is of the form: f(k1, v1, ...f(kn-1, vn-1, f(kn, vn, s))). A foldRightWithKeyCont allows early termination by not calling the continuation.

@Experimental

def forEach [kvef] ( f : k -> (v -> Unit \ ef) m : DelayMap[k, v] ) : Unit \ ef

Source

Applies f to every (key, value) of m.

@Experimental

def forEachWithIndex [kvef] ( f : Int32 -> (k -> (v -> Unit \ ef)) m : DelayMap[k, v] ) : Unit \ ef

Source

Applies f to tuple (index, key, value) formed of the keys and values of DelayMap m and the index of the traversal.

@Experimental@Parallel

def forceAll [kv] ( m : DelayMap[k, v] ) : Unit \ Pure

Source

Forces all values in m.

@Experimental

def get [kv] ( k : k m : DelayMap[k, v] ) : Option[v] \ Pure with Order[k]

Source

Returns Some(v) if k => v is in m.

Otherwise returns None.

@Experimental

def getWithDefault [kv] ( k : k d : v m : DelayMap[k, v] ) : v \ Pure with Order[k]

Source

Returns v if k => v is in m.

Otherwise, returns d.

@Experimental

def insert [kv] ( k : k v : v m : DelayMap[k, v] ) : DelayMap[k, v] \ Pure with Order[k]

Source

Returns m with k => v.

@Experimental@LazyWhenPure

def insertWith [vefk] ( f : v -> (v -> v \ ef) k : k v : v m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

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

Otherwise, updates m with k => v.

@Experimental@LazyWhenPure

def insertWithKey [kvef] ( f : k -> (v -> (v -> v \ ef)) k : k v : v m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

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

Otherwise, updates m with k => v.

@Experimental

def isEmpty [kv] ( m : DelayMap[k, v] ) : Bool \ Pure

Source

Returns true if and only if m is the empty map, i.e. Map(Nil).

@Experimental

def iterator [rab] ( rc : Region[r] m : DelayMap[a, b] ) : Iterator[(a, b), r, r] \ r

Source

Returns an iterator over all key-value pairs in m.

@Experimental

def joinKeys [kv] ( sep : String m : DelayMap[k, v] ) : String \ Pure with ToString[k]

Source

Returns the concatenation of the string representation of each key k in m with sep inserted between each element.

@Experimental

def joinValues [kv] ( sep : String m : DelayMap[k, v] ) : String \ Pure with ToString[v]

Source

Returns the concatenation of the string representation of each value v in m with sep inserted between each element.

@Experimental

def joinWith [kvef] ( f : k -> (v -> String \ ef) sep : String m : DelayMap[k, v] ) : String \ ef

Source

Returns the concatenation of the string representation of each key-value pair k => v in m according to f with sep inserted between each element.

@Experimental

def keysOf [kv] ( m : DelayMap[k, v] ) : Set[k] \ Pure with Order[k]

Source

Returns the keys of m.

@Experimental@ParallelWhenPure@LazyWhenPure

def map [v1efv2k] ( f : v1 -> v2 \ ef m : DelayMap[k, v1] ) : DelayMap[k, v2] \ ef

Source

Returns a map with mappings k => f(v) for every k => v in m.

Purity reflective:

  • Runs in parallel when given a pure function f.
  • Applies f lazily if f is pure.
@Experimental@ParallelWhenPure@LazyWhenPure

def mapWithKey [kv1efv2] ( f : k -> (v1 -> v2 \ ef) m : DelayMap[k, v1] ) : DelayMap[k, v2] \ ef

Source

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

Purity reflective:

  • Runs in parallel when given a pure function f.
  • Applies f lazily if f is pure.
@Experimental

def maximumKey [kv] ( m : DelayMap[k, v] ) : Option[(k, v)] \ Pure

Source

Optionally finds k => v where k is the largest key according to the Order instance of k.

Returns None if m is empty.

@Experimental@ParallelWhenPure

def maximumKeyBy [kefv] ( cmp : k -> (k -> Comparison \ ef) m : DelayMap[k, v] ) : Option[(k, v)] \ ef

Source

Optionally finds k => v where k is the largest key according to the given comparator cmp.

Returns None if m is empty.

Purity reflective: Runs in parallel when given a pure function cmp.

@Experimental@Parallel

def maximumValue [kv] ( m : DelayMap[k, v] ) : Option[(k, v)] \ Pure with Order[v]

Source

Optionally finds k => v where v is the largest value.

Returns None if m is empty.

@Experimental@ParallelWhenPure

def maximumValueBy [vefk] ( cmp : v -> (v -> Comparison \ ef) m : DelayMap[k, v] ) : Option[(k, v)] \ ef

Source

Optionally finds k => v where k is the largest value according to the given comparator cmp.

Returns None if m is empty.

Purity reflective: Runs in parallel when given a pure function cmp.

@Experimental

def memberOf [kv] ( k : k m : DelayMap[k, v] ) : Bool \ Pure with Order[k]

Source

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

@Experimental

def minimumKey [kv] ( m : DelayMap[k, v] ) : Option[(k, v)] \ Pure

Source

Optionally finds k => v where k is the smallest key according to the Order instance of k.

Returns None if m is empty.

@Experimental@ParallelWhenPure

def minimumKeyBy [kefv] ( cmp : k -> (k -> Comparison \ ef) m : DelayMap[k, v] ) : Option[(k, v)] \ ef

Source

Optionally finds k => v where k is the smallest key according to the given comparator cmp.

Returns None if m is empty.

Purity reflective: Runs in parallel when given a pure function cmp.

@Experimental@Parallel

def minimumValue [kv] ( m : DelayMap[k, v] ) : Option[(k, v)] \ Pure with Order[v]

Source

Optionally finds k => v where v is the smallest value.

Returns None if m is empty.

@Experimental@ParallelWhenPure

def minimumValueBy [vefk] ( cmp : v -> (v -> Comparison \ ef) m : DelayMap[k, v] ) : Option[(k, v)] \ ef

Source

Optionally finds k => v where k is the smallest value according to the given comparator cmp.

Returns None if m is empty.

Purity reflective: Runs in parallel when given a pure function cmp.

@Experimental

def reduceLeft [vefk] ( f : v -> (v -> v \ ef) m : DelayMap[k, v] ) : Option[v] \ ef

Source

Applies f to all values in m going from left to right until a single value v is obtained. Returns Some(v).

That is, the result is of the form: Some(f(...f(f(v1, v2), v3)..., vn))

Returns None if m is the empty map.

@Experimental

def reduceLeftWithKey [kvef] ( f : k -> (v -> (k -> (v -> (k, v) \ ef))) m : DelayMap[k, v] ) : Option[(k, v)] \ ef

Source

Applies f to all mappings in m going from left to right until a single mapping (k, v) is obtained. Returns Some((k, v)).

That is, the result is of the form: Some(f(...f(f(k1, v1, k2, v2), k3, v3)..., kn, vn))

Returns None if m is the empty map.

@Experimental

def reduceRight [vefk] ( f : v -> (v -> v \ ef) m : DelayMap[k, v] ) : Option[v] \ ef

Source

Applies f to all values in m going from right to left until a single value v is obtained. Returns Some(v).

That is, the result is of the form: Some(f(v1, ...f(vn-2, f(vn-1, vn))...))

Returns None if m is the empty DelayMap.

@Experimental

def reduceRightWithKey [kvef] ( f : k -> (v -> (k -> (v -> (k, v) \ ef))) m : DelayMap[k, v] ) : Option[(k, v)] \ ef

Source

Applies f to all mappings in m going from right to left until a single mapping (k, v) is obtained. Returns Some((k, v)).

That is, the result is of the form: Some(f(k1, v1, ...f(kn-2, vn-2, f(kn-1, vn-1, kn, vn))...))

Returns None if m is the empty DelayMap.

@Experimental

def remove [kv] ( k : k m : DelayMap[k, v] ) : DelayMap[k, v] \ Pure with Order[k]

Source

Removes the mapping k from the map m.

@Experimental

def singleton [kv] ( k : k v : v ) : DelayMap[k, v] \ Pure with Order[k]

Source

Returns the singleton map where key k is mapped to value v.

@Experimental

def size [kv] ( m : DelayMap[k, v] ) : Int32 \ Pure

Source

Returns the number of keys in m.

@Experimental@Parallel

def sumKeys [v] ( m : DelayMap[Int32, v] ) : Int32 \ Pure

Source

Returns the sum of all values in m.

@Experimental@Parallel

def sumValues [k] ( m : DelayMap[k, Int32] ) : Int32 \ Pure

Source

Returns the sum of all values in m.

@Experimental@ParallelWhenPure

def sumWith [kvef] ( f : k -> (v -> Int32 \ ef) m : DelayMap[k, v] ) : Int32 \ ef

Source

Returns the sum of all key-value pairs k => v in m according to the function f.

Purity reflective: Runs in parallel when given a pure function f.

@Experimental

def toDelayList [kv] ( m : DelayMap[k, v] ) : DelayList[(k, v)] \ Pure

Source

Returns the map m as a DelayList of key-value pairs.

@Experimental

def toList [kv] ( m : DelayMap[k, v] ) : List[(k, v)] \ Pure

Source

Returns the map m as a list of key-value pairs.

@Experimental@Parallel

def toMap [kv] ( m : DelayMap[k, v] ) : Map[k, v] \ Pure

Source

Returns m as a Map, i.e. every value is forced.

@Experimental

def toMutDeque [rkv] ( rc : Region[r] m : DelayMap[k, v] ) : MutDeque[(k, v), r] \ r

Source

Returns the map m as a MutDeque of key-value pairs.

@Experimental@Parallel

def toMutMap [rkv] ( rc : Region[r] m : DelayMap[k, v] ) : MutMap[k, v, r] \ r

Source

Returns m as a mutable map.

@Experimental

def toSet [kv] ( m : DelayMap[k, v] ) : Set[(k, v)] \ Pure with Order[k] Order[v]

Source

Returns the map m as a set of key-value pairs.

@Experimental

def toString [kv] ( m : DelayMap[k, v] ) : String \ Pure with ToString[k] ToString[v]

Source

Returns a string representation of the given DelayMap m.

@Experimental@Lazy

def union [kv] ( m1 : DelayMap[k, v] m2 : DelayMap[k, v] ) : DelayMap[k, v] \ Pure with Order[k]

Source

Returns the left-biased union of m1 and m2.

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

@Experimental@LazyWhenPure

def unionWith [vefk] ( f : v -> (v -> v \ ef) m1 : DelayMap[k, v] m2 : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Returns the union of m1 and m2 where key collisions are resolved with the merge function f.

Purity reflective: Applies f lazily if f is pure.

@Experimental@LazyWhenPure

def unionWithKey [kvef] ( f : k -> (v -> (v -> v \ ef)) m1 : DelayMap[k, v] m2 : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Returns the union of m1 and m2 where key collisions are resolved with the merge function f, taking both the key and values.

Purity reflective: Applies f lazily if f is pure.

@Experimental@LazyWhenPure

def update [vefk] ( f : v -> Option[v] \ ef k : k m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Updates m with k => v1 if k => v is in m and f(v) = Some(v1). Otherwise, returns m.

Purity reflective: Applies f lazily if f is pure.

@Experimental@LazyWhenPure

def updateWithKey [kvef] ( f : k -> (v -> Option[v] \ ef) k : k m : DelayMap[k, v] ) : DelayMap[k, v] \ ef with Order[k]

Source

Updates m with k => v1 if k => v is in m and f(k, v) = Some(v1). Otherwise, returns m.

Purity reflective: Applies f lazily if f is pure.

@Experimental

def valuesOf [kv] ( m : DelayMap[k, v] ) : List[v] \ Pure

Source

Returns the values of m.