Scoped effects
In the context of algebraic effects and handlers, it is easy to see that handlers have two purposes:
- They determine the scope whose effects will be handled.
- They define how these effects will be handled, by giving code for each effect.
The theory and practice of scoped effects is about decomposing these two aspects.
Semantics
There seem to be two approaches to the semantics of scoped effects, viz.
- through indexed algebras Pirog et al. 2018
- through functorial algebras Yang et al. 2022
References
- The scoped effects approach was introduced in
@inproceedings{wu_effect_2014,
title = {Effect handlers in scope},
doi = {10.1145/2633357.2633358},
booktitle = {Proceedings of the 2014 {ACM} {SIGPLAN} Symposium on Haskell},
publisher = {Association for Computing Machinery},
author = {Wu, Nicolas and Schrijvers, Tom and Hinze, Ralf},
date = {2014}
}
- Category-theoretic models of scoped effects are given in
@inproceedings{pirog_2018,
title = {Syntax and Semantics for Operations with Scopes},
doi = {10.1145/3209108.3209166},
pages = {809--818},
booktitle = {Proceedings of the 33rd Annual {ACM}/{IEEE} Symposium on Logic in Computer Science},
publisher = {Association for Computing Machinery},
author = {Piróg, Maciej and Schrijvers, Tom and Wu, Nicolas and Jaskelioff, Mauro},
date = {2018},
}
@inproceedings{yang_2022,
location = {Cham},
title = {Structured Handling of Scoped Effects},
volume = {13240},
doi = {10.1007/978-3-030-99336-8_17},
series = {Lecture Notes in Computer Science},
pages = {462--491},
booktitle = {Programming Languages and Systems},
publisher = {Springer International Publishing},
author = {Yang, Zhixuan and Paviotti, Marco and Wu, Nicolas and Van Den Berg, Birthe and Schrijvers, Tom},
editor = {Sergey, Ilya},
date = {2022},
}