This file contains hidden or 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
//Does this compile? | |
inline fun <A, B> A.andThen(block: (A) -> Unit) { | |
Runnable { | |
block(this) | |
} | |
} |
This file contains hidden or 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
//region DSL | |
class ExecutionCancelationException(val failure: Any?) : RuntimeException() | |
interface ExecutionScope<in F> { | |
fun fail(f: F): Nothing = throw ExecutionCancelationException(f) | |
} | |
sealed interface Result<out F, out R> | |
data class Success<out R>(val result: R) : Result<Nothing, R> |
OlderNewer