Suggestion: rcontext.resume-shallow
should not run the return
clauses
#510
Labels
rcontext.resume-shallow
should not run the return
clauses
#510
Unlike Frank, Koka does not remove the return clause when resuming a shallow handler (this was originally spotted by @jasigal). This is currently necessary since
resume-shallow
has the same return type asresume
(which runs the potentially-type-changing return clause): https://koka-lang.github.io/koka/doc/std_core_hnd.html#type_space_resume_contextHowever, this is quite annoying in practice. For example, we could attempt to get Frank-style pattern matching on shallow handlers by writing:
This is not just a bit ugly, but also less efficient since
resume-shallow(())
should really be a tail-call here.I would guess that to fix this the
resume-context
should carry two different types: The return type before running thereturn()
clause and the type after running thereturn()
clause. Then in https://koka-lang.github.io/koka/doc/std_core_hnd-source.html#prompt the case:should really be:
The text was updated successfully, but these errors were encountered: