TArray

zio.stm.TArray
See theTArray companion object
final class TArray[A] extends AnyVal

Wraps array of TRef and adds methods for convenience.

Attributes

Companion
object
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def apply(index: Int): USTM[A]

Extracts value from ref in array.

Extracts value from ref in array.

Attributes

def collectFirst[B](pf: PartialFunction[A, B]): USTM[Option[B]]

Finds the result of applying a partial function to the first value in its domain.

Finds the result of applying a partial function to the first value in its domain.

Attributes

def collectFirstSTM[E, B](pf: PartialFunction[A, STM[E, B]]): STM[E, Option[B]]

Finds the result of applying an transactional partial function to the first value in its domain.

Finds the result of applying an transactional partial function to the first value in its domain.

Attributes

def contains(a: A): USTM[Boolean]

Determine if the array contains a specified value.

Determine if the array contains a specified value.

Attributes

def count(p: A => Boolean): USTM[Int]

Count the values in the array matching a predicate.

Count the values in the array matching a predicate.

Attributes

def countSTM[E](p: A => STM[E, Boolean]): STM[E, Int]

Count the values in the array matching a transactional predicate.

Count the values in the array matching a transactional predicate.

Attributes

def exists(p: A => Boolean): USTM[Boolean]

Determine if the array contains a value satisfying a predicate.

Determine if the array contains a value satisfying a predicate.

Attributes

def existsSTM[E](p: A => STM[E, Boolean]): STM[E, Boolean]

Determine if the array contains a value satisfying a transactional predicate.

Determine if the array contains a value satisfying a transactional predicate.

Attributes

def find(p: A => Boolean): USTM[Option[A]]

Find the first element in the array matching a predicate.

Find the first element in the array matching a predicate.

Attributes

def findLast(p: A => Boolean): USTM[Option[A]]

Find the last element in the array matching a predicate.

Find the last element in the array matching a predicate.

Attributes

def findLastSTM[E](p: A => STM[E, Boolean]): STM[E, Option[A]]

Find the last element in the array matching a transactional predicate.

Find the last element in the array matching a transactional predicate.

Attributes

def findSTM[E](p: A => STM[E, Boolean]): STM[E, Option[A]]

Find the first element in the array matching a transactional predicate.

Find the first element in the array matching a transactional predicate.

Attributes

The first entry of the array, if it exists.

The first entry of the array, if it exists.

Attributes

def fold[Z](zero: Z)(op: (Z, A) => Z): USTM[Z]

Atomically folds using a pure function.

Atomically folds using a pure function.

Attributes

def foldSTM[E, Z](zero: Z)(op: (Z, A) => STM[E, Z]): STM[E, Z]

Atomically folds using a transactional function.

Atomically folds using a transactional function.

Attributes

def forall(p: A => Boolean): USTM[Boolean]

Atomically evaluate the conjunction of a predicate across the members of the array.

Atomically evaluate the conjunction of a predicate across the members of the array.

Attributes

def forallSTM[E](p: A => STM[E, Boolean]): STM[E, Boolean]

Atomically evaluate the conjunction of a transactional predicate across the members of the array.

Atomically evaluate the conjunction of a transactional predicate across the members of the array.

Attributes

def foreach[E](f: A => STM[E, Unit]): STM[E, Unit]

Atomically performs transactional effect for each item in array.

Atomically performs transactional effect for each item in array.

Attributes

def indexOf(a: A): USTM[Int]

Get the first index of a specific value in the array or -1 if it does not occur.

Get the first index of a specific value in the array or -1 if it does not occur.

Attributes

def indexOf(a: A, from: Int): USTM[Int]

Get the first index of a specific value in the array, starting at a specific index, or -1 if it does not occur.

Get the first index of a specific value in the array, starting at a specific index, or -1 if it does not occur.

Attributes

def indexWhere(p: A => Boolean): USTM[Int]

Get the index of the first entry in the array matching a predicate.

Get the index of the first entry in the array matching a predicate.

Attributes

def indexWhere(p: A => Boolean, from: Int): USTM[Int]

Get the index of the first entry in the array, starting at a specific index, matching a predicate.

Get the index of the first entry in the array, starting at a specific index, matching a predicate.

Attributes

def indexWhereSTM[E](p: A => STM[E, Boolean]): STM[E, Int]

Get the index of the first entry in the array matching a transactional predicate.

Get the index of the first entry in the array matching a transactional predicate.

Attributes

def indexWhereSTM[E](p: A => STM[E, Boolean], from: Int): STM[E, Int]

Starting at specified index, get the index of the next entry that matches a transactional predicate.

Starting at specified index, get the index of the next entry that matches a transactional predicate.

Attributes

def lastIndexOf(a: A): USTM[Int]

Get the last index of a specific value in the array or -1 if it does not occur.

Get the last index of a specific value in the array or -1 if it does not occur.

Attributes

def lastIndexOf(a: A, end: Int): USTM[Int]

Get the first index of a specific value in the array, bounded above by a specific index, or -1 if it does not occur.

Get the first index of a specific value in the array, bounded above by a specific index, or -1 if it does not occur.

Attributes

The last entry in the array, if it exists.

The last entry in the array, if it exists.

Attributes

def maxOption(implicit ord: Ordering[A]): USTM[Option[A]]

Atomically compute the greatest element in the array, if it exists.

Atomically compute the greatest element in the array, if it exists.

Attributes

def minOption(implicit ord: Ordering[A]): USTM[Option[A]]

Atomically compute the least element in the array, if it exists.

Atomically compute the least element in the array, if it exists.

Attributes

def reduceOption(op: (A, A) => A): USTM[Option[A]]

Atomically reduce the array, if non-empty, by a binary operator.

Atomically reduce the array, if non-empty, by a binary operator.

Attributes

def reduceOptionSTM[E](op: (A, A) => STM[E, A]): STM[E, Option[A]]

Atomically reduce the non-empty array using a transactional binary operator.

Atomically reduce the non-empty array using a transactional binary operator.

Attributes

def size: Int

Returns the size of the array.

Returns the size of the array.

Attributes

def toChunk: USTM[Chunk[A]]

Collects all elements into a chunk.

Collects all elements into a chunk.

Attributes

def toList: USTM[List[A]]

Collects all elements into a list.

Collects all elements into a list.

Attributes

def transform(f: A => A): USTM[Unit]

Atomically updates all elements using a pure function.

Atomically updates all elements using a pure function.

Attributes

def transformSTM[E](f: A => STM[E, A]): STM[E, Unit]

Atomically updates all elements using a transactional effect.

Atomically updates all elements using a transactional effect.

Attributes

def update(index: Int, fn: A => A): USTM[Unit]

Updates element in the array with given function.

Updates element in the array with given function.

Attributes

def updateSTM[E](index: Int, fn: A => STM[E, A]): STM[E, Unit]

Atomically updates element in the array with given transactional effect.

Atomically updates element in the array with given transactional effect.

Attributes