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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Brady, E.: Programming and reasoning with algebraic effects and dependent types. In: ICFP 2013 (2013)
Chang, B.-M., Jo, J.-W., Yi, K., Choe, K.-M.: Interprocedural exception analysis for Java. In: SAC 2001 (2001)
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)
Fluet, M., Morrisett, G.: Monadic regions. Journal of Functional Programming (2006)
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)
Harper, R.: Exceptions are shared secrets (December 2012), http://existentialtype.wordpress.com/
Harper, R.: Practical Foundations for Programming Languages. Cambridge U. Press (2012)
Hughes, J.: Global variables in Haskell. Journal of Functional Programming (2004)
Kiselyov, O., Sabry, A., Swords, C.: Extensible effects: An alternative to monad transformers. In: Haskell 2013 (2013)
Launchbury, J., Peyton Jones, S.: Lazy functional state threads. SIGPLAN Notices (1994)
Levy, H.M.: Capability-based computer systems, vol. 12. Digital Press Bedford, Massachusetts (1984)
Liang, S., Hudak, P., Jones, M.: Monad transformers and modular interpreters. In: POPL 1995 (1995)
Miller, M.S.: Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control. PhD thesis (2006)
Milner, R., Harper, R., MacQueen, D., Tofte, M.: The Definition of Standard ML. MIT Press (1997) (revised)
Moggi, E.: Notions of computation and monads. Information and Computation (1991)
Piponi, D.: Tagging monad transformer layers (2010), http://blog.sigfpe.com/2010/02/tagging-monad-transformer-layers.html
Robillard, M., Murphy, G.: Static analysis to support the evolution of exception structure in object-oriented systems. In: TOSEM 2003 (2003)
Saltzer, J.H., Schroeder, M.D.: The protection of information in computer systems (1975)
Sangiorgi, D., Walker, D.: The Pi-Calculus: A Theory of Mobile Processes. Cambridge U. Press (2003)
Schaefer, C.F., Bundy, G.N.: Static analysis of exception handling in Ada. Software—Practice and Experience 23(10), 1157–1174 (1993)
Schrijvers, T., Oliveira, B.C.: Monads, zippers and views: virtualizing the monad stack. In: ICFP 2011 (2011)
Sheard, T., Jones, S.P.: Template meta-programming for haskell. SIGPLAN Not. 37(12), 60–75 (2002)
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)
Terei, D., Marlow, S., Peyton Jones, S., Mazières, D.: Safe Haskell. In: Haskell 2012 (2012)
Wadler, P.: The essence of functional programming. In: POPL 1992 (1992)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)