//arrow-fx-stm/arrow.fx.stm/STM/remove

remove

common open fun <K, V> TMap<K, V>.remove(k: K)

Remove a key value pair from a map

import arrow.fx.stm.TMap
import arrow.fx.stm.atomically

suspend fun main() {
  //sampleStart
  val tmap = TMap.new<Int, String>()
  atomically {
    tmap[1] = "Hello"
    tmap.remove(1)
  }
  //sampleEnd
}

common open fun <A> TSet<A>.remove(a: A)

Remove an element from the set.

import arrow.fx.stm.TSet
import arrow.fx.stm.atomically

suspend fun main() {
  //sampleStart
  val tset = TSet.new<String>()
  atomically {
    tset.insert("Hello")
    tset.remove("Hello")
  }
  //sampleEnd
}

Do you like Arrow?

Arrow Org
<