Just do it: simple monadic equational reasoning

  • Authors:
  • Jeremy Gibbons;Ralf Hinze

  • Affiliations:
  • University of Oxford, Oxford, United Kingdom;University of Oxford, Oxford, United Kingdom

  • Venue:
  • Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

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.