skip to main content
10.1145/2034773.2034777acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Just do it: simple monadic equational reasoning

Published:19 September 2011Publication History

ABSTRACT

One of the appeals of pure functional programming is that it is so amenable to equational reasoning. One of the problems of pure functional programming is that it rules out computational effects. Moggi and Wadler showed how to get round this problem by using monads to encapsulate the effects, leading in essence to a phase distinction - a pure functional evaluation yielding an impure imperative computation. Still, it has not been clear how to reconcile that phase distinction with the continuing appeal of functional programming; does the impure imperative part become inaccessible to equational reasoning? We think not; and to back that up, we present a simple axiomatic approach to reasoning about programs with computational effects.

Skip Supplemental Material Section

Supplemental Material

_talk1.mp4

mp4

54.3 MB

References

  1. N. Benton, J. Hughes, and E. Moggi. Monads and effects. In G. Barthe, P. Dybjer, L. Pinto, and J. Saraiva, editors, APPSEM 2000, volume 2395 of LNCS, pages 42--122. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. L. Erkök and J. Launchbury. Recursive monadic bindings. In ICFP, pages 174--185. ACM, September 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Erwig and S. Kollmansberger. Probabilistic functional programming in Haskell. J. Funct. Prog., 16(1):21--34, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Gibbons and R. Bird. Effective reasoning about effectful traversals. Work in progress, Mar. 2011.Google ScholarGoogle Scholar
  5. M. Giry. A categorical approach to probability theory. In Categorical Aspects of Topology and Analysis, volume 915 of LNM, pages 68--85. Springer, 1981.Google ScholarGoogle Scholar
  6. S. Goncharov, L. Schröder, and T. Mossakowski. Kleene monads: Handling iteration in a framework of generic effects. In CALCO, volume 5728 of LNCS, pages 18--33, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Hinze. Prolog's control constructs in a functional setting: Axioms and implementation. Intern. J. Found. Comput. Sci., 12(2):125--170, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  8. C. A. R. Hoare. A couple of novelties in the propositional calculus. Z. Math. Logik Grundlag. Math., 31(2):173--178, 1985.Google ScholarGoogle ScholarCross RefCross Ref
  9. G. Hutton and D. Fulger. Reasoning about effects: Seeing the wood through the trees. In TFP, May 2008.Google ScholarGoogle Scholar
  10. M. Hyland and J. Power. The category theoretic understanding of universal algebra: Lawvere theories and monads. Electron. Notes Theoret. Comput. Sci., 172:437--458, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Jones and G. Plotkin. A probabilistic powerdomain of evaluations. In LICS, pages 186--195, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. F. W. Lawvere. The category of probabilistic mappings. Preprint - we haven't managed to obtain a copy of this manuscript, 1962.Google ScholarGoogle Scholar
  13. F. W. Lawvere. Functorial Semantics of Algebraic Theories. PhD thesis, Columbia University, 1963. Also available with commentary as textitTheory and Applications of Categories Reprint 5.Google ScholarGoogle ScholarCross RefCross Ref
  14. S. Mac Lane. Categories for the Working Mathematician. Springer-Verlag, 1971.Google ScholarGoogle ScholarCross RefCross Ref
  15. A. McIver and C. Morgan. Abstraction, Refinement and Proof for Probabilistic Systems. Springer Verlag, 2005. Google ScholarGoogle Scholar
  16. E. Moggi. Notions of computation and monads. Inform. & Comput., 93(1), 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. Nanevski, G. Morrisett, and L. Birkedal. Hoare Type Theory, polymorphism and separation. J. Funct. Prog., 18(5,6):865--911, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Nanevski, G. Morrisett, A. Shinnar, P. Govereau, and L. Birkedal. Ynot: Dependent types for imperative programs. In ICFP, pages 229--240, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. W. O'Hearn, H. Yang, and J. C. Reynolds. Separation and information hiding. In POPL, pages 268--280, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. B. O'Sullivan, J. Goerzen, and D. Stewart. Real World Haskell. O'Reilly, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. S. Peyton Jones. Tackling the awkward squad: Monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell. In T. Hoare, M. Broy, and R. Steinbrüggen, editors, Engineering Theories of Software Construction, volume 180 of NATO Science Series, pages 47--96. IOS Press, 2001.Google ScholarGoogle Scholar
  22. S. Peyton Jones. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  23. S. Peyton Jones and P. Wadler. Imperative functional programming. In POPL, pages 71--84, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Plotkin and J. Power. Notions of computation determine monads. In FOSSACS, volume 2303 of LNCS, pages 342--356, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. G. Plotkin and J. Power. Algebraic operations and generic effects. Appl. Cat. Struct., 11(1):69--94, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  26. G. D. Plotkin and M. Pretnar. Handlers of algebraic effects. In ESOP, volume 5502 of LNCS, pages 80--94, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. N. Ramsey and A. Pfeffer. Stochastic lambda calculus and monads of probability distributions. In POPL, pages 154--165, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Rosenhouse. The Monty Hall Problem: The Remarkable Story of Math's Most Contentious Brain Teaser. Oxford University Press, 2009.Google ScholarGoogle Scholar
  29. L. Schröder and T. Mossakowski. HasCasl: Integrated higher-order specification and program development. Theoretical Comput. Sci., 410(12-13):1217--1260, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. W. Swierstra. A Functional Specification of Effects. PhD thesis, University of Nottingham, November 2008.Google ScholarGoogle Scholar
  31. W. Swierstra. A Hoare logic for the state monad. In TPHOLs, volume 5674 of LNCS, pages 440--451. Springer-Verlag, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. W. Swierstra and T. Altenkirch. Beauty in the beast. In Haskell Workshop, pages 25--36, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. R. Tix. Continuous D-Cones: Convexity and Powerdomain Constructions. PhD thesis, Technische Universität Darmstadt, 1999.Google ScholarGoogle Scholar
  34. D. Varacca and G. Winskel. Distributing probability over non-determinism. Math. Struct. Comput. Sci., 16(1):87--113, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. M. Vos Savant. Ask Marilyn. Parade Magazine, 9th September 1990. See also http://www.marilynvossavant.com/articles/gameshow.html.Google ScholarGoogle Scholar
  36. P. Wadler. A critique of Abelson and Sussman: Why calculating is better than scheming. SIGPLAN Not., 22(3):8, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. P. Wadler. Comprehending monads. Math. Struct. Comput. Sci., 2(4):461--493, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  38. P. Wadler. Monads for functional programming. In M. Broy, editor, Program Design Calculi: Proceedings of the Marktoberdorf Summer School, 1992.Google ScholarGoogle Scholar
  39. A. Yakeley, textitet al. MonadPlus reform proposal. http://www.haskell.org/haskellwiki/MonadPlus_reform_proposal, Jan. 2006.Google ScholarGoogle Scholar
  40. W. Yi and K. G. Larsen. Testing probabilistic and nondeterministic processes. In Protocol Specification, Testing and Verification XII, pages 47--61, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Just do it: simple monadic equational reasoning

                      Recommendations

                      Comments

                      Login options

                      Check if you have access through your login credentials or your institution to get full access on this article.

                      Sign in
                      • Published in

                        cover image ACM Conferences
                        ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
                        September 2011
                        470 pages
                        ISBN:9781450308656
                        DOI:10.1145/2034773
                        • cover image ACM SIGPLAN Notices
                          ACM SIGPLAN Notices  Volume 46, Issue 9
                          ICFP '11
                          September 2011
                          456 pages
                          ISSN:0362-1340
                          EISSN:1558-1160
                          DOI:10.1145/2034574
                          Issue’s Table of Contents

                        Copyright © 2011 ACM

                        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                        Publisher

                        Association for Computing Machinery

                        New York, NY, United States

                        Publication History

                        • Published: 19 September 2011

                        Permissions

                        Request permissions about this article.

                        Request Permissions

                        Check for updates

                        Qualifiers

                        • research-article

                        Acceptance Rates

                        ICFP '11 Paper Acceptance Rate33of92submissions,36%Overall Acceptance Rate333of1,064submissions,31%

                        Upcoming Conference

                        ICFP '24

                      PDF Format

                      View or Download as a PDF file.

                      PDF

                      eReader

                      View online with eReader.

                      eReader