No; the handlers that correspond to the current effect row are stored in a vector, and the Eff
monad is basically ReaderT HandlerVector IO
. So if you call an effect it just fetches the corresponding handler from the vector and calls it. This has nothing to do with delimited continuations per se, but it does work well with delimited continuations.
if you have a way to make
a -> {IO} b
intoa -> {}b
, the latter means “yeah this function might do some impure stuff but it’s okay, you don’t have to provide a handler” and this is mind bending
This is not possible in any effect system that I know of in Haskell. You can make Eff '[State Int] a
into an Eff '[] a
, but that is because the behavior is referentially transparent. I don’t think you’re supposed to be able to disguise an impure operation as pure in effect systems.
delimited continuations make calling the wrong continuation or ignoring a continuation way too easy, which leads to your program being messed up too easily
This has some truth to it, in that if you use “raw” delimited continuation operations these bugs may pop up. And effect systems wrap around these raw functionalities and use the type system to ensure they’re always used in a safe manner. So this is not a thing that effect system users should worry about.