arrow-fx / arrow.fx / MVar / uncancellableOf

uncancellableOf

fun <F, A> uncancellableOf(initial: A, AS: Async<F>): Kind<F, MVar<F, A>>

Create an uncancellable MVar that’s initialized to an initial value.

import arrow.fx.*
import arrow.fx.extensions.io.async.async

fun main(args: Array<String>) {
  //sampleStart
  val mvar: IOOf<MVar<ForIO, Int>> = MVar.uncancellableOf(5, IO.async())
  //sampleEnd
}

Do you like Arrow?

Arrow Org
<