Laws of Monadic Error Handling

  • Härmel NestraEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11884)


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.


Monads Error handling Parsing Equational reasoning 



This work was partially supported by the Estonian Research Council grant PSG61. The author thanks all anonymous reviewers for their valuable feedback.


  1. 1.
    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).
  2. 2.
    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). Scholar
  3. 3.
    Altenkirch, T., Chapman, J., Uustalu, T.: Monads need not be endofunctors. Log. Methods Comput. Sci. 11(1) (2015).
  4. 4.
    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).
  5. 5.
    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).
  6. 6.
    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).
  7. 7.
  8. 8.
  9. 9.
    Hutton, G., Meijer, E.: Monadic parser combinators. Technical report NOTTCS-TR-96-4, University of Nottingham (1996)Google Scholar
  10. 10.
    Hutton, G., Meijer, E.: Monadic parsing in Haskell. J. Funct. Program. 8(4), 437–444 (1998). Scholar
  11. 11.
    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).
  12. 12.
    The Libraries archives. Proposal: Laws for MTL classes.
  13. 13.
    Malakhovski, J.: Exceptionally monadic error handling. CoRR abs/1810.13430 (2018).
  14. 14.
    Moggi, E.: An abstract view of programming languages. Technical report ECS-LFCS-90-113, University of Edinburgh (1990)Google Scholar
  15. 15.
    Nestra, H.: Double applicative functors. In: Fischer, B., Uustalu, T. (eds.) ICTAC 2018. LNCS, vol. 11187, pp. 333–353. Springer, Cham (2018). Scholar
  16. 16.
    Wadler, P.: Comprehending monads. In: LISP and Functional Programming, pp. 61–78 (1990).
  17. 17.
    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).

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Institute of Computer ScienceUniversity of TartuTartuEstonia

Personalised recommendations