Skip to content

Instantly share code, notes, and snippets.

@Nymphium Nymphium/typed-delimcc.kk
Last active Aug 29, 2018

Embed
What would you like to do?
typed prompt-less shift/reset in Koka language
module typed-delimcc
public effect subcont0<a> {
fun shift0(f : (b -> a) -> a) : b
}
public fun reset0(th : () -> subcont0<a> a) : a {
handle(th) {
shift0(f) -> f(resume)
}
}
public effect subcont<a> {
fun shift(f : (b -> div a) -> a) : b
}
public fun reset(th: () -> <subcont<a>, div> a) : div a {
handle(th) {
shift(f) -> unsafe-nodiv{reset{unsafe-nodiv{f(resume)}}}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.