Nothing Special   »   [go: up one dir, main page]

Skip to main content

Laws of Monadic Error Handling

  • Conference paper
  • First Online:
Theoretical Aspects of Computing – ICTAC 2019 (ICTAC 2019)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 11884))

Included in the following conference series:

  • 399 Accesses

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.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Similar content being viewed by others

Notes

  1. 1.

    The observations in this paragraph were suggested by an anonymous reviewer of an earlier version of this paper.

References

  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). https://doi.org/10.4230/LIPIcs.TYPES.2013.1

  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). https://doi.org/10.1007/978-3-642-12032-9_21

    Chapter  Google Scholar 

  3. 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

  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). https://doi.org/10.1145/1111037.1111056

  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). https://doi.org/10.1145/964001.964011

  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). https://doi.org/10.1145/2034773.2034777

  7. Haskell. https://www.haskell.org

  8. Haskell hierarchical libraries. https://downloads.haskell.org/~ghc/latest/docs/html/libraries/index.html

  9. Hutton, G., Meijer, E.: Monadic parser combinators. Technical report NOTTCS-TR-96-4, University of Nottingham (1996)

    Google Scholar 

  10. Hutton, G., Meijer, E.: Monadic parsing in Haskell. J. Funct. Program. 8(4), 437–444 (1998). https://doi.org/10.1017/S0956796898003050

    Article  MATH  Google Scholar 

  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). https://doi.org/10.1145/199448.199528

  12. The Libraries archives. Proposal: Laws for MTL classes. https://mail.haskell.org/pipermail/libraries/2019-April/029549.html

  13. Malakhovski, J.: Exceptionally monadic error handling. CoRR abs/1810.13430 (2018). http://arxiv.org/abs/1810.13430

  14. Moggi, E.: An abstract view of programming languages. Technical report ECS-LFCS-90-113, University of Edinburgh (1990)

    Google Scholar 

  15. 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

    Chapter  Google Scholar 

  16. Wadler, P.: Comprehending monads. In: LISP and Functional Programming, pp. 61–78 (1990). https://doi.org/10.1145/91556.91592

  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). https://doi.org/10.1145/143165.143169

Download references

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

Authors

Corresponding author

Correspondence to Härmel Nestra .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics