flix

0.78.0

Range

enum Range[t: Type] with Eq, ToStringSource
case Range(t, t)

Type of half-open ranges of discrete values.

A range (b, e) contains the values from b (inclusive) to e (exclusive).

Type of half-open ranges of discrete values, and its functions.

Instances

instance Eq[Range[t]] with Eq[t]Source
instance ForEach[Range[t]] with Discrete[t]Source
type Elm = t
instance Iterable[Range[t]] with Discrete[t]Source
type Elm = t
instance ToString[Range[t]] with ToString[t]Source

Definitions

def forEach(f: t -> Unit \ ef, r: Range[t]): Unit \ ef with Discrete[t]§ Source

Applies f to every element of r.

def intersection(r1: Range[t], r2: Range[t]): Range[t] with Order[t]§ Source

Returns the intersection of the ranges r1 and r2.

The result is empty if r1 and r2 do not overlap.

def isEmpty(r: Range[t]): Bool with Order[t]§ Source

Returns true if and only if the range r is empty, i.e. it contains no elements.

def iterator(rc: Region[r], rng: Range[t]): Iterator[t, r, r] \ r with Discrete[t]§ Source

Returns an iterator over the elements of r.

def memberOf(x: t, r: Range[t]): Bool with Order[t]§ Source

Returns true if and only if x is a member of the range r.

def overlaps(r1: Range[t], r2: Range[t]): Bool with Order[t]§ Source

Returns true if and only if the ranges r1 and r2 overlap, i.e. they share at least one element.

def toList(r: Range[t]): List[t] with Discrete[t]§ Source

Returns the elements of r as a list.

def toSet(r: Range[t]): Set[t] with Discrete[t]§ Source

Returns the elements of r as a set.

def toVector(r: Range[t]): Vector[t] with Discrete[t]§ Source

Returns the elements of r as a vector.