allows the same thing (which is precisely why early raise builders were made using
suspend
magic):
Copy code
suspend fun <A> doubleNegationElimination(block: suspend (suspend (A) -> Nothing) -> Nothing): A = suspendCoroutine { cont ->
block.startCoroutine({ value ->
suspendCoroutine<Nothing> {
cont.resume(value)
}
}, cont)
}
arrow intensifies 1
s
simon.vergauwen
05/05/2025, 7:10 AM
Yes, it's a cool pattern sadly it comes with some strange side-effects on a language level..
❤️ 1
y
Youssef Shoaib [MOD]
05/05/2025, 7:12 AM
EDIT: I wrote this then noticed the pun 🤦🏼 I need more coffee...
Like what? It's fundamentally what allows Arrow to work, no?
Allowing this also allows
suspend
to work (a CPS transform is similar to a double-negation translation from classical logic to intuitionistic logic). This allows us access to the "mother of all monads", which I consider a definite plus!