An Effect System for Algebraic Effects and Handlers

  • Andrej Bauer
  • Matija Pretnar
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8089)

Abstract

We present an effect system for algebraic effects and handlers. Because handlers may transform an effectful computation into a pure one, the effect system is non-monotone in the sense that effects do not just accumulate, but may also be deleted from types or generally transformed. We also provide denotational semantics for the effect system, based on a domain-theoretic model with partial equivalence relations. The semantics validates equational reasoning about effectful computations.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1988, pp. 47–57. ACM, New York (1988)CrossRefGoogle Scholar
  2. 2.
    Kammar, O., Plotkin, G.D.: Algebraic foundations for effect-dependent optimisations. In: Field, J., Hicks, M. (eds.) POPL, pp. 349–360. ACM (2012)Google Scholar
  3. 3.
    Talpin, J.P., Jouvelot, P.: Polymorphic type, region and effect inference. Journal of Functional Programming 2(3), 245–271 (1992)MathSciNetMATHCrossRefGoogle Scholar
  4. 4.
    Wadler, P.: The marriage of effects and monads. ACM SIGPLAN Notices 34(1), 63–74 (1999)CrossRefGoogle Scholar
  5. 5.
    Kammar, O., Lindley, S., Oury, N.: Handlers in action. In: The 1st ACM SIGPLAN Workshop on Higher-Order Programming with Effects (2012)Google Scholar
  6. 6.
    Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. arXiv:1203.1539 (2012)Google Scholar
  7. 7.
    Plotkin, G., Power, J.: Algebraic operations and generic effects. Applied Categorical Structures 11(1), 69–94 (2003)MathSciNetMATHCrossRefGoogle Scholar
  8. 8.
    Plotkin, G., Pretnar, M.: Handlers of algebraic effects. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 80–94. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  9. 9.
    Kiselyov, O.: Lazy IO breaks equational reasoning (April 2013), http://okmij.org/ftp/Haskell/index.html#lazyIO-not-True
  10. 10.
    Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML. MIT Press (1997)Google Scholar
  11. 11.
    Leroy, X., Doligez, D., Frisch, A., Garrigue, J., Rémy, D., Vouillon, J.: The OCaml system (release 3.12): Documentation and user’s manual. Institut National de Recherche en Informatique et en Automatique (2011)Google Scholar
  12. 12.
    Benton, N., Hughes, J., Moggi, E.: Monads and effects. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) APPSEM 2000. LNCS, vol. 2395, pp. 42–122. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  13. 13.
    Levy, P.B., Power, J., Thielecke, H.: Modelling environments in call-by-value programming languages. Information and Computation 185, 182–210 (2003)MathSciNetMATHCrossRefGoogle Scholar
  14. 14.
    Fuh, Y.C., Mishra, P.: Type inference with subtypes. In: Ganzinger, H. (ed.) ESOP 1988. LNCS, vol. 300, pp. 94–114. Springer, Heidelberg (1988)CrossRefGoogle Scholar
  15. 15.
    Hyland, M., Plotkin, G., Power, J.: Combining effects: Sum and tensor. Theoretical Computer Science 357(1-3), 70–99 (2006)MathSciNetMATHCrossRefGoogle Scholar
  16. 16.
    Plotkin, G., Power, J.: Notions of computation determine monads. In: Nielsen, M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 342–356. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  17. 17.
    Reynolds, J.: The meaning of types—from intrinsic to extrinsic semantics. Technical report, Department of Computer Science, University of Aarhus (2000)Google Scholar
  18. 18.
    Moggi, E.: Notions of computation and monads. Information and Computation 93(1), 55–92 (1991)MathSciNetMATHCrossRefGoogle Scholar
  19. 19.
    Pretnar, M.: The Logic and Handling of Algebraic Effects. PhD thesis, School of Informatics, University of Edinburgh (2010)Google Scholar
  20. 20.
    Murdoch, G.J., Pitts, A.M.: A new approach to abstract syntax with variable binding. Formal Aspects of Computing 13(3-5), 341–363 (2001)Google Scholar
  21. 21.
    Stark, I.: Categorical models for local names. LISP and Symbolic Computation 9(1), 77–107 (1996)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Andrej Bauer
    • 1
  • Matija Pretnar
    • 1
  1. 1.Faculty of Mathematics and PhysicsUniversity of LjubljanaSlovenia

Personalised recommendations