Last active
October 12, 2019 18:40
-
-
Save rpiotrow/f6003b08780a3ae943ad5f08a87ea440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Suspendable<F> { | |
suspend fun <A: Any> Kind<F, A>.suspended(): A | |
} | |
fun IO.Companion.suspendable(): Suspendable<ForIO> = object: Suspendable<ForIO> { | |
override suspend fun <A : Any> Kind<ForIO, A>.suspended(): A { | |
val io = this.fix() | |
return io.suspended() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment