Monadic augment and generalised short cut fusion

8Citations
Citations of this article
5Readers
Mendeley users who have this article in their library.

Abstract

Monads are commonplace programming devices that are used to uniformly structure computations; in particular, they are often used to mimic the effects of impure features such as state, error handling, and I/O. This paper further develops the monadic programming paradigm by investigating the extent to which monadic computations can be optimised by using generalisations of short cut fusion to eliminate monadic structures whose sole purpose is to "glue together" monadic program components. Ghani, Uustalu, and Vene have recently shown that every inductive type has an associated build combinator and an associated short cut fusion law. They have also used the notion of a parameterised monad to describe those monads that give rise to inductive types, and have shown that the standard augment combinators and cata/augment fusion rules for algebraic data types can be generalised to fixed points of all parameterised monads. We revisit these augment combinators and generalised short cut fusion rules for such types but consider them from a functional programming perspective, rather than a categorical one. In addition to making the category-theoretic ideas of Ghani, Uustalu, and Vene more easily accessible to a wider audience of functional programmers, we demonstrate their practical applicability by developing nontrivial application programs and performing modest benchmarking on them. We also show how the cata/augment rules can serve as the basis for deriving additional generic fusion laws, thus opening the way for an algebra of fusion. Finally, we offer deep theoretical insights, arguing that the augment combinators are monadic in nature, and thus that the cata/build and cata/augment rules are arguably the best generally applicable fusion rules obtainable.

Cite

CITATION STYLE

APA

Ghani, N., & Johann, P. (2007). Monadic augment and generalised short cut fusion. Journal of Functional Programming, 17(6), 731–776. https://doi.org/10.1017/S0956796807006314

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free