Skip to main content

Effect Capabilities for Haskell

  • Conference paper
Programming Languages (SBLP 2014)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8771))

Included in the following conference series:

  • 594 Accesses

Abstract

Computational effects complicate the tasks of reasoning about and maintaining software, due to the many kinds of interferences that can occur. While different proposals have been formulated to alleviate the fragility and burden of dealing with specific effects, such as state or exceptions, there is no prevalent robust mechanism that addresses the general interference issue. Building upon the idea of capability-based security, we propose effect capabilities as an effective and flexible manner to control monadic effects and their interferences. Capabilities can be selectively shared between modules to establish secure effect-centric coordination. We further refine capabilities with type-based permission lattices to allow fine-grained decomposition of authority. We provide an implementation of effect capabilities in Haskell, using type classes to establish a way to statically share capabilities between modules, as well as to check proper access permissions to effects at compile time. We exemplify how to tame effect interferences using effect capabilities, by treating state and exceptions.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Brady, E.: Programming and reasoning with algebraic effects and dependent types. In: ICFP 2013 (2013)

    Google Scholar 

  2. Chang, B.-M., Jo, J.-W., Yi, K., Choe, K.-M.: Interprocedural exception analysis for Java. In: SAC 2001 (2001)

    Google Scholar 

  3. Coelho, R., Rashid, A., Garcia, A., Ferrari, F., Cacho, N., Kulesza, U., von Staa, A., Lucena, C.: Assessing the impact of aspects on exception flows: An exploratory study. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 207–234. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. Fluet, M., Morrisett, G.: Monadic regions. Journal of Functional Programming (2006)

    Google Scholar 

  5. Gifford, D.K., Lucassen, J.M.: Integrating functional and imperative programming. In: Proceedings of the ACM Conference on LISP and Functional Programming (LFP 1986) (1986)

    Google Scholar 

  6. Harper, R.: Exceptions are shared secrets (December 2012), http://existentialtype.wordpress.com/

  7. Harper, R.: Practical Foundations for Programming Languages. Cambridge U. Press (2012)

    Google Scholar 

  8. Hughes, J.: Global variables in Haskell. Journal of Functional Programming (2004)

    Google Scholar 

  9. Kiselyov, O., Sabry, A., Swords, C.: Extensible effects: An alternative to monad transformers. In: Haskell 2013 (2013)

    Google Scholar 

  10. Launchbury, J., Peyton Jones, S.: Lazy functional state threads. SIGPLAN Notices (1994)

    Google Scholar 

  11. Levy, H.M.: Capability-based computer systems, vol. 12. Digital Press Bedford, Massachusetts (1984)

    Google Scholar 

  12. Liang, S., Hudak, P., Jones, M.: Monad transformers and modular interpreters. In: POPL 1995 (1995)

    Google Scholar 

  13. Miller, M.S.: Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control. PhD thesis (2006)

    Google Scholar 

  14. Milner, R., Harper, R., MacQueen, D., Tofte, M.: The Definition of Standard ML. MIT Press (1997) (revised)

    Google Scholar 

  15. Moggi, E.: Notions of computation and monads. Information and Computation (1991)

    Google Scholar 

  16. Piponi, D.: Tagging monad transformer layers (2010), http://blog.sigfpe.com/2010/02/tagging-monad-transformer-layers.html

  17. Robillard, M., Murphy, G.: Static analysis to support the evolution of exception structure in object-oriented systems. In: TOSEM 2003 (2003)

    Google Scholar 

  18. Saltzer, J.H., Schroeder, M.D.: The protection of information in computer systems (1975)

    Google Scholar 

  19. Sangiorgi, D., Walker, D.: The Pi-Calculus: A Theory of Mobile Processes. Cambridge U. Press (2003)

    Google Scholar 

  20. Schaefer, C.F., Bundy, G.N.: Static analysis of exception handling in Ada. Software—Practice and Experience 23(10), 1157–1174 (1993)

    Article  Google Scholar 

  21. Schrijvers, T., Oliveira, B.C.: Monads, zippers and views: virtualizing the monad stack. In: ICFP 2011 (2011)

    Google Scholar 

  22. Sheard, T., Jones, S.P.: Template meta-programming for haskell. SIGPLAN Not. 37(12), 60–75 (2002)

    Article  Google Scholar 

  23. Snyder, M., Alexander, P.: Monad factory: Type-indexed monads. In: Page, R., Horváth, Z., Zsók, V. (eds.) TFP 2010. LNCS, vol. 6546, pp. 198–213. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  24. Terei, D., Marlow, S., Peyton Jones, S., Mazières, D.: Safe Haskell. In: Haskell 2012 (2012)

    Google Scholar 

  25. Wadler, P.: The essence of functional programming. In: POPL 1992 (1992)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Figueroa, I., Tabareau, N., Tanter, É. (2014). Effect Capabilities for Haskell. In: Quintão Pereira, F.M. (eds) Programming Languages. SBLP 2014. Lecture Notes in Computer Science, vol 8771. Springer, Cham. https://doi.org/10.1007/978-3-319-11863-5_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-11863-5_7

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-11862-8

  • Online ISBN: 978-3-319-11863-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics