Abstract
One of the numerous applications of monads in functional programming is error handling. This paper proposes several new axiomatics for equational reasoning about monadic computations with error handling and studies their relationships with each other and with axiomatics considered earlier. The primary intended application area is deterministic top-down parsing.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
The observations in this paragraph were suggested by an anonymous reviewer of an earlier version of this paper.
References
Ahman, D., Uustalu, T.: Update monads: cointerpreting directed containers. In: Matthes, R., Schubert, A. (eds.) 19th International Conference on Types for Proofs and Programs, TYPES 2013, Toulouse, France, 22–26 April 2013. LIPIcs, vol. 26, pp. 1–23. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2013). https://doi.org/10.4230/LIPIcs.TYPES.2013.1
Altenkirch, T., Chapman, J., Uustalu, T.: Monads need not be endofunctors. In: Ong, L. (ed.) FoSSaCS 2010. LNCS, vol. 6014, pp. 297–311. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-12032-9_21
Altenkirch, T., Chapman, J., Uustalu, T.: Monads need not be endofunctors. Log. Methods Comput. Sci. 11(1) (2015). https://doi.org/10.2168/LMCS-11(1:3)2015
Danielsson, N.A., Hughes, J., Jansson, P., Gibbons, J.: Fast and loose reasoning is morally correct. In: Morrisett, J.G., Jones, S.L.P. (eds.) Proceedings of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2006, Charleston, South Carolina, USA, 11–13 January 2006, pp. 206–217. ACM (2006). https://doi.org/10.1145/1111037.1111056
Ford, B.: Parsing expression grammars: a recognition-based syntactic foundation. In: Jones, N.D., Leroy, X. (eds.) Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2004, Venice, Italy, 14–16 January 2004, pp. 111–122. ACM (2004). https://doi.org/10.1145/964001.964011
Gibbons, J., Hinze, R.: 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, 19–21 September 2011, pp. 2–14. ACM (2011). https://doi.org/10.1145/2034773.2034777
Haskell. https://www.haskell.org
Haskell hierarchical libraries. https://downloads.haskell.org/~ghc/latest/docs/html/libraries/index.html
Hutton, G., Meijer, E.: Monadic parser combinators. Technical report NOTTCS-TR-96-4, University of Nottingham (1996)
Hutton, G., Meijer, E.: Monadic parsing in Haskell. J. Funct. Program. 8(4), 437–444 (1998). https://doi.org/10.1017/S0956796898003050
Liang, S., Hudak, P., Jones, M.P.: Monad transformers and modular interpreters. In: Cytron, R.K., Lee, P. (eds.) Conference Record of POPL 1995: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Francisco, California, USA, 23–25 January 1995, pp. 333–343. ACM Press (1995). https://doi.org/10.1145/199448.199528
The Libraries archives. Proposal: Laws for MTL classes. https://mail.haskell.org/pipermail/libraries/2019-April/029549.html
Malakhovski, J.: Exceptionally monadic error handling. CoRR abs/1810.13430 (2018). http://arxiv.org/abs/1810.13430
Moggi, E.: An abstract view of programming languages. Technical report ECS-LFCS-90-113, University of Edinburgh (1990)
Nestra, H.: Double applicative functors. In: Fischer, B., Uustalu, T. (eds.) ICTAC 2018. LNCS, vol. 11187, pp. 333–353. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-02508-3_18
Wadler, P.: Comprehending monads. In: LISP and Functional Programming, pp. 61–78 (1990). https://doi.org/10.1145/91556.91592
Wadler, P.: The essence of functional programming. In: Sethi, R. (ed.) Conference Record of the Nineteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Albuquerque, New Mexico, USA, 19–22 January 1992, pp. 1–14. ACM Press (1992). https://doi.org/10.1145/143165.143169
Acknowledgement
This work was partially supported by the Estonian Research Council grant PSG61. The author thanks all anonymous reviewers for their valuable feedback.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Nestra, H. (2019). Laws of Monadic Error Handling. In: Hierons, R., Mosbah, M. (eds) Theoretical Aspects of Computing – ICTAC 2019. ICTAC 2019. Lecture Notes in Computer Science(), vol 11884. Springer, Cham. https://doi.org/10.1007/978-3-030-32505-3_21
Download citation
DOI: https://doi.org/10.1007/978-3-030-32505-3_21
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-32504-6
Online ISBN: 978-3-030-32505-3
eBook Packages: Computer ScienceComputer Science (R0)