TArray

final class TArray[A] extends AnyVal

Wraps array of TRef and adds methods for convenience.

Companion:
object
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

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

Extracts value from ref in array.

Extracts value from ref in array.

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.

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.

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

Determine if the array contains a specified value.

Determine if the array contains a specified value.

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.

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.

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.

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.

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.

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.

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.

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.

The first entry of the array, if it exists.

The first entry of the array, if it exists.

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

Atomically folds using a pure function.

Atomically folds using a pure function.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

The last entry in the array, if it exists.

The last entry in the array, if it exists.

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.

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.

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.

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.

def size: Int

Returns the size of the array.

Returns the size of the array.

def toChunk: USTM[Chunk[A]]

Collects all elements into a chunk.

Collects all elements into a chunk.

def toList: USTM[List[A]]

Collects all elements into a list.

Collects all elements into a list.

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

Atomically updates all elements using a pure function.

Atomically updates all elements using a pure function.

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.

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.

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.