flix

0.65.0

MutHashSet

Definitions

def add(x: t, s: MutHashSet[t, r]): Unit \ r with Eq[t], Hash[t] Source

Adds the element x to the mutable set s.

def addAll(m: m[t], s: MutHashSet[t, r]): Unit \ r + Aef[m] with Eq[t], Hash[t], Foldable[m] Source

Adds all elements in the collection m to the mutable set s.

def clear(s: MutHashSet[t, r]): Unit \ r Source

Removes all elements from the mutable set s.

def copy(rc: Region[r1], s: MutHashSet[t, r]): MutHashSet[t, r1] \ r + r1 with Eq[t], Hash[t] Source

Returns a shallow copy of the mutable set s.

def count(f: t -> Bool \ ef, s: MutHashSet[t, r]): Int32 \ ef + r Source

Returns the number of elements in the mutable set s that satisfy the predicate function f.

def empty(rc: Region[r]): MutHashSet[t, r] \ r Source

Returns a new empty set.

def emptyWithCapacity(rc: Region[r], capacity: Int32): MutHashSet[t, r] \ r Source

Returns a new empty set with the given capacity.

The capacity is rounded up to the minimum capacity.

def exists(f: t -> Bool \ ef, s: MutHashSet[t, r]): Bool \ ef + r Source

Returns true if and only if at least one element in the mutable set s satisfies the predicate function f.

Returns false if s is the empty set.

def find(f: t -> Bool, s: MutHashSet[t, r]): Option[t] \ r Source

Alias for findLeft.

The function f must be pure.

def findLeft(f: t -> Bool, s: MutHashSet[t, r]): Option[t] \ r Source

Optionally returns the first element of the mutable set s that satisfies the predicate function f when searching from left to right.

The function f must be pure.

def findRight(f: t -> Bool, s: MutHashSet[t, r]): Option[t] \ r Source

Optionally returns the first element of the mutable set s that satisfies the predicate function f when searching from right to left.

The function f must be pure.

def first(s: MutHashSet[t, r]): Option[t] \ r Source

Returns the first element that was inserted into the mutable set s.

Returns None if the set is empty.

def foldLeft(f: b -> (t -> b \ ef), i: b, s: MutHashSet[t, r]): b \ ef + r Source

Applies f to a start value i and all elements in the mutable set s going from left to right.

That is, the result is of the form: f(...f(f(i, x1), x2)..., xn).

def foldMap(f: t -> b \ ef, s: MutHashSet[t, r]): b \ ef + r with Monoid[b] Source

Returns the result of mapping each element and combining the results.

def foldRight(f: t -> (b -> b \ ef), z: b, s: MutHashSet[t, r]): b \ ef + r Source

Applies f to a start value z and all elements in the mutable set s going from right to left.

That is, the result is of the form: f(x1, ...f(xn-1, f(xn, z))...).

def forAll(f: t -> Bool \ ef, s: MutHashSet[t, r]): Bool \ ef + r Source

Returns true if and only if all elements in the mutable set s satisfy the predicate function f.

Returns true if s is the empty set.

def forEach(f: t -> Unit \ ef, s: MutHashSet[t, r]): Unit \ ef + r Source

Applies f to every element of the mutable hash set s.

def forEachWithIndex(f: Int32 -> (t -> Unit \ ef), s: MutHashSet[t, r]): Unit \ ef + r Source

Applies f to every element of the mutable hash set s along with that element's index.

def isEmpty(s: MutHashSet[t, r]): Bool \ r Source

Returns true if s is empty.

def iterator(rc: Region[r1], s: MutHashSet[t, r]): Iterator[t, r + r1, r1] \ r + r1 Source

Returns an iterator over s.

def join(sep: String, s: MutHashSet[t, r]): String \ r with ToString[t] Source

Returns the concatenation of the string representation of each element in s with sep inserted between each element.

def joinWith(f: t -> String \ ef, sep: String, s: MutHashSet[t, r]): String \ ef + r Source

Returns the concatenation of the string representation of each element in s according to f with sep inserted between each element.

def last(s: MutHashSet[t, r]): Option[t] \ r Source

Returns the last element that was inserted into the mutable set s.

Returns None if the set is empty.

def memberOf(x: t, s: MutHashSet[t, r]): Bool \ r with Eq[t], Hash[t] Source

Returns true if and only if x is a member of the mutable set s.

def nonEmpty(s: MutHashSet[t, r]): Bool \ r Source

Returns true if s is non-empty.

def refine(f: t -> Bool, s: MutHashSet[t, r]): Unit \ r with Eq[t], Hash[t] Source

Removes all elements from the mutable set s that do not satisfy the predicate function f.

The function f must be pure.

def remove(x: t, s: MutHashSet[t, r]): Unit \ r with Eq[t], Hash[t] Source

Removes the element x from the mutable set s.

def removeAll(m: m[t], s: MutHashSet[t, r]): Unit \ r + Aef[m] with Eq[t], Hash[t], Foldable[m] Source

Removes all elements in the collection m from the mutable set s.

def replace(src: { src = t }, dst: { dst = t }, s: MutHashSet[t, r]): Unit \ r with Eq[t], Hash[t] Source

Replaces the element src with the element dst if src is in the mutable set s.

The mutable set s is unchanged if the element src is not in it.

def retainAll(m: m[t], s: MutHashSet[t, r]): Unit \ r + Aef[m] with Eq[t], Hash[t], Foldable[m] Source

Removes all elements from the mutable set s that are not in collection m.

def singleton(rc: Region[r], x: t): MutHashSet[t, r] \ r with Eq[t], Hash[t] Source

Returns a new set with the element x.

def size(s: MutHashSet[t, r]): Int32 \ r Source

Returns the number of elements in s.

def toArray(rc: Region[r1], s: MutHashSet[t, r]): Array[t, r1] \ r + r1 Source

Returns the mutable set s as an array.

def toList(s: MutHashSet[t, r]): List[t] \ r Source

Returns the mutable set s as a list.

def toMap(s: MutHashSet[(a, b), r]): Map[a, b] \ r with Order[a] Source

Returns the association set s as a map.

If s contains multiple mappings with the same key, toMap does not make any guarantees about which mapping will be in the resulting map.

def toSet(s: MutHashSet[t, r]): Set[t] \ r with Order[t] Source

Returns the mutable set s as an immutable set.

def toString(s: MutHashSet[a, r]): String \ r with ToString[a] Source

Returns a string representation of the given mutable hash set s.

def toVector(s: MutHashSet[t, r]): Vector[t] \ r Source

Returns the mutable set s as a vector.