flix

0.61.0

ForEach

trait ForEach[t: Type]Source

A trait for data structures that support a forEach operation.

Associated Types

type Aef: EffSource

The effect of forEach.

type Elm: TypeSource

The type of elements in the data structure.

Instances

instance ForEach[Array[a, r]]Source
instance ForEach[BPlusTree[k, v, r]]Source
instance ForEach[Chain[a]]Source
instance ForEach[DelayList[a]]Source
instance ForEach[DelayMap[k, v]]Source
instance ForEach[WithIndex[t]] with ForEach[t]Source
instance ForEach[WithFilter[t, a]] with ForEach[t]Source
instance ForEach[WithMap[t, a, b]] with ForEach[t]Source
instance ForEach[WithZip[s, t]] with Iterable[s], Iterable[t]Source
instance ForEach[List[a]]Source
instance ForEach[Map[k, v]]Source
instance ForEach[MutDeque[a, r]]Source
instance ForEach[MutList[a, r]]Source
instance ForEach[MutMap[k, v, r]]Source
instance ForEach[MutPriorityQueue[a, r]]Source
instance ForEach[MutSet[a, r]]Source
instance ForEach[Nec[a]]Source
instance ForEach[Nel[a]]Source
instance ForEach[Option[a]]Source
instance ForEach[Range[t]] with Discrete[t]Source
instance ForEach[RedBlackTree[k, v]]Source
instance ForEach[Set[a]]Source
instance ForEach[Vector[a]]Source

Signatures

def forEach(f: Elm[t] -> Unit \ ef, t: t): Unit \ ef + Aef[t] with ForEach[t] Source

Applies f to each element in the data structure.

Module Definitions

def withFilter(p: a -> Bool, m: t): WithFilter[t, a] with ForEach[t] where ForEach.Elm[t] ~ a Source

Returns a view for m that filters out elements that don't match p.

def withIndex(m: t): WithIndex[t] with ForEach[t] Source

Returns a view for m that wraps each element with its index.

def withMap(f: a -> b, m: t): WithMap[t, a, b] with ForEach[t] Source

Returns a view for m that applies f to each element.

def withZip(left: s, right: t): WithZip[s, t] with Iterable[s], Iterable[t] Source

Returns a view that zips left and right together.