Last active
December 7, 2021 07:17
-
-
Save Nymphium/3cb574cb511a179a30390599e6e51669 to your computer and use it in GitHub Desktop.
typed prompt-less shift/reset in Koka language
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
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