Hostname: page-component-cc8bf7c57-llmch Total loading time: 0 Render date: 2024-12-10T13:00:46.010Z Has data issue: false hasContentIssue false

Local algebraic effect theories

Published online by Cambridge University Press:  11 May 2020

ŽIGA LUKŠIČ
Affiliation:
Faculty of Mathematics and Physics, University of Ljubljana, Slovenia, (e-mails: ziga.luksic@fmf.uni-lj.si, matija.pretnar@fmf.uni-lj.si)
MATIJA PRETNAR
Affiliation:
Faculty of Mathematics and Physics, University of Ljubljana, Slovenia, (e-mails: ziga.luksic@fmf.uni-lj.si, matija.pretnar@fmf.uni-lj.si)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Algebraic effects are computational effects that can be described with a set of basic operations and equations between them. As many interesting effect handlers do not respect these equations, most approaches assume a trivial theory, sacrificing both reasoning power and safety. We present an alternative approach where the type system tracks equations that are observed in subparts of the program, yielding a sound and flexible logic, and paving a way for practical optimisations and reasoning tools.

Type
Research Article
Copyright
Copyright © The Author(s) 2020. Published by Cambridge University Press

Footnotes

This material is based upon work supported by the Air Force Office of Scientific Research under award number FA9550-17-1-0326.

References

Ahman, D. (2017) Fibred Computational Effects. Ph.D. thesis, School of Informatics, University of Edinburgh.Google Scholar
Ahman, D. (2018) Handling fibred algebraic effects. PACMPL 2(POPL), 7:17:29.Google Scholar
Bauer, A. & Pretnar, M. (2014) An effect system for algebraic effects and handlers. Log. Methods Comput. Sci. 10(4), 129.Google Scholar
Bauer, A. & Pretnar, M. (2015) Programming with algebraic effects and handlers. J. Log. Algebr. Meth. Program. 84(1), 108123.CrossRefGoogle Scholar
Bauer, A., Hofmann, M., Pretnar, M. & Yallop, J. (2016) From theory to practice of algebraic effects and handlers. Dagstuhl Rep. 6(3), 4458.Google Scholar
Biernacki, D., Piróg, M., Polesiuk, P. & Sieczkowski, F. (2018) Handle with care: Relational interpretation of algebraic effects and handlers. PACMPL 2(POPL), 8:1–8:30.Google Scholar
Brady, E. (2013) Programming and reasoning with algebraic effects and dependent types. In Morrisett, G. & Uustalu, T. (eds), ACM SIGPLAN International Conference on Functional Programming, ICFP’13, Boston, MA, USA, September 25–27, 2013. ACM, pp. 133144.Google Scholar
Chandrasekaran, S. K., Leijen, D., Pretnar, M. & Schrijvers, T. (2018) Algebraic effect handlers go mainstream. Dagstuhl Rep. 8(4), 104125.Google Scholar
Claessen, K. & Hughes, J. (2000) Quickcheck: A lightweight tool for random testing of haskell programs. In Odersky, M. & Wadler, P. (eds), Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP’00), Montreal, Canada, September 18–21, 2000. ACM, pp. 268279.CrossRefGoogle Scholar
de Moura, L. M. & Bjørner, N. (2008) Z3: An efficient SMT solver. In TACAS. Lecture Notes in Computer Science, vol. 4963. Springer, pp. 337340.Google Scholar
Forster, Y., Kammar, O., Lindley, S. & Pretnar, M. (2017) On the expressive power of user-defined effects: Effect handlers, monadic reflection, delimited control. PACMPL 1(ICFP), 13:113:29.Google Scholar
Gibbons, J. & Hinze, R. (2011) Just do it: Simple monadic equational reasoning. In Chakravarty, M. M. T., Hu, Z. & Danvy, O. (eds), Proceeding of the 16th ACM SIGPLAN International Conference on Functional Programming, ICFP 2011, Tokyo, Japan, September 19–21, 2011. ACM, pp. 214.CrossRefGoogle Scholar
Hillerström, D. & Lindley, S. (2016) Liberating effects with rows and handlers. In Chapman, J. & Swierstra, W. (eds), Proceedings of the 1st International Workshop on Type-Driven Development, TyDe@ICFP 2016, Nara, Japan, September 18, 2016. ACM, pp. 1527.CrossRefGoogle Scholar
Kammar, O. & Plotkin, G. D. (2012). Algebraic foundations for effect-dependent optimisations. In Field, J. & Hicks, M. (eds), Proceedings of the 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, Philadelphia, Pennsylvania, USA, January 22–28, 2012. ACM, pp. 349360.CrossRefGoogle Scholar
Kammar, O. & Pretnar, M. (2017) No value restriction is needed for algebraic effects and handlers. J. Funct. Program. 27, e7.CrossRefGoogle Scholar
Kammar, O., Lindley, S. & Oury, N. (2013) Handlers in action. In Morrisett, G. & Uustalu, T. (eds), ACM SIGPLAN International Conference on Functional Programming, ICFP’13, Boston, MA, USA, September 25–27, 2013. ACM, pp. 145158.CrossRefGoogle Scholar
Leijen, D. (2017) Type directed compilation of row-typed algebraic effects. In Castagna, G. & Gordon, A. D. (eds), Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18–20, 2017. ACM, pp. 486499.Google Scholar
Levy, P. B., Power, J. & Thielecke, H. (2003) Modelling environments in call-by-value programming languages. Inf. Comput. 185(2), 182210.CrossRefGoogle Scholar
McLaughlin, C., McKinna, J. & Stark, I. (2018) Triangulating context lemmas. In Andronick, J. & Felty, A. P. (eds), Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2018, Los Angeles, CA, USA, January 8–9, 2018. ACM, pp. 102114.Google Scholar
Moggi, E. (1991) Notions of computation and monads. Inf. Comput. 93(1), 5592.CrossRefGoogle Scholar
Plotkin, G. D. & Power, J. (2001) Adequacy for algebraic effects. In Honsell, F. & Miculan, M. (eds), Foundations of Software Science and Computation Structures, 4th International Conference, FOSSACS 2001 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2001 Genova, Italy, April 2–6, 2001, Proceedings. Lecture Notes in Computer Science, vol. 2030. Springer, pp. 124.CrossRefGoogle Scholar
Plotkin, G. D. & Power, J. (2003) Algebraic operations and generic effects. Appl. Categorical Struct. 11(1), 6994.CrossRefGoogle Scholar
Plotkin, G. D. & Pretnar, M. (2008) A logic for algebraic effects. In Proceedings of the Twenty-Third Annual IEEE Symposium on Logic in Computer Science, LICS 2008, 24–27 June 2008, Pittsburgh, PA, USA. IEEE Computer Society, pp. 118129.Google Scholar
Plotkin, G. D. & Pretnar, M. (2009) Handlers of algebraic effects. In Castagna, G. (ed), Programming Languages and Systems, 18th European Symposium on Programming, ESOP 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, York, UK, March 22–29, 2009. Proceedings. Lecture Notes in Computer Science, vol. 5502. Springer, pp. 8094.Google Scholar
Plotkin, G. D. & Pretnar, M. (2013) Handling algebraic effects. Log. Methods Comput. Sci. 9(4), 136.Google Scholar
Pretnar, M. (2010) Logic and Handling of Algebraic Effects. Ph.D. thesis, University of Edinburgh, UK.Google Scholar
Pretnar, M. (2015) An introduction to algebraic effects and handlers. Invited tutorial paper. Electr. Notes Theor. Comput. Sci. 319, 1935.CrossRefGoogle Scholar
Saleh, A. H., Karachalias, G., Pretnar, M. & Schrijvers, T. (2018) Explicit effect subtyping. In Ahmed, A. (ed), Programming Languages and Systems - 27th European Symposium on Programming, ESOP 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Thessaloniki, Greece, April 14–20, 2018, Proceedings. Lecture Notes in Computer Science, vol. 10801. Springer, pp. 327354.Google Scholar

Lukšič and Pretnar supplementary material

Lukšič and Pretnar supplementary material

Download Lukšič and Pretnar supplementary material(Video)
Video 61.6 MB
Submit a response

Discussions

No Discussions have been published for this article.