shift

open suspend override fun <B> shift(r: E): B

Short-circuit the Cont computation with value R.

suspend fun test() = checkAll(Arb.string()) { str ->
cont<String, Int> {
shift(str)
}.fold({ it shouldBe str }, { fail("Computation never finishes") })
}

Sources

common source
Link copied to clipboard