TxnVarMapOps

ai.entrolution.bengal.stm.syntax.all.`package`.TxnVarMapOps
implicit class TxnVarMapOps[F[_], K, V](txnVarMap: TxnVarMap[F, K, V])(implicit evidence$1: STM[F])

Syntax for TxnVarMap with F-variant operations.

Attributes

Source
package.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def get: Txn[Map[K, V]]

Retrieves an immutable snapshot of the entire map.

Retrieves an immutable snapshot of the entire map. Prefer per-key access for performance.

Attributes

Source
package.scala
def get(key: => K): Txn[Option[V]]

Retrieves the value for a key, returning None if the key was deleted in this transaction.

Retrieves the value for a key, returning None if the key was deleted in this transaction.

Attributes

Source
package.scala
def modify(f: (Map[K, V]) => Map[K, V]): Txn[Unit]

Modifies the entire map by applying a pure function.

Modifies the entire map by applying a pure function.

Attributes

Source
package.scala
def modify(key: => K, f: V => V): Txn[Unit]

Modifies the value for a key by applying a pure function.

Modifies the value for a key by applying a pure function. Throws if the key is absent.

Attributes

Source
package.scala
def modifyF(f: (Map[K, V]) => F[Map[K, V]]): Txn[Unit]

Modifies the entire map by applying an effectful function.

Modifies the entire map by applying an effectful function. The function must not encapsulate side effects.

Attributes

Source
package.scala
def modifyF(key: => K, f: V => F[V]): Txn[Unit]

Modifies the value for a key by applying an effectful function.

Modifies the value for a key by applying an effectful function. The function must not encapsulate side effects.

Attributes

Source
package.scala
def remove(key: => K): Txn[Unit]

Removes a key-value pair from the map.

Removes a key-value pair from the map. Throws if the key is absent.

Attributes

Source
package.scala
def set(newValueMap: => Map[K, V]): Txn[Unit]

Replaces the entire map state.

Replaces the entire map state. Creates/deletes keys as needed.

Attributes

Source
package.scala
def set(newValueMap: F[Map[K, V]]): Txn[Unit]

Replaces the entire map state via an effect.

Replaces the entire map state via an effect. The effect must not encapsulate side effects.

Attributes

Source
package.scala
def set(key: => K, newValue: => V): Txn[Unit]

Upserts a key-value pair.

Upserts a key-value pair. Creates the key if not present.

Attributes

Source
package.scala
def setF(key: => K, newValue: F[V]): Txn[Unit]

Upserts a key-value pair via an effect.

Upserts a key-value pair via an effect. The effect must not encapsulate side effects.

Attributes

Source
package.scala