Hostname: page-component-89b8bd64d-sd5qd Total loading time: 0 Render date: 2026-05-13T18:54:24.379Z Has data issue: false hasContentIssue false

Monadic augment and generalised short cut fusion

Published online by Cambridge University Press:  01 November 2007

NEIL GHANI
Affiliation:
University of Nottingham, Nottingham, NG7 2RD, UK email: nxg@cs.nott.ac.uk
PATRICIA JOHANN
Affiliation:
Rutgers University, Camden, NJ 08102, USA email: pjohann@crab.rutgers.edu
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Article
Copyright
Copyright © Cambridge University Press 2007
Submit a response

Discussions

No Discussions have been published for this article.