Reference. Breadth-First Traversal via Staging
Cite
Cited by (2)
Modular models of monoids with operations by lifting functors along fibrations yang-2026-modular
Inspired by Plotkin and Power’s algebraic treatment of computational effects and the principle of notions of computations as monoids, we propose a categorical framework for equational theories and models of monoids equipped with operations. This framework generalises Plotkin and Power’s algebraic treatment of effectful operations taking or returning values as input or output to operations that may take or return computations as input or output. Additionally, to give semantic models of computational effects in a modular way, we introduce a formal theory of modular constructions of algebraic structures based on the framework of lifting functors along fibrations.
Modular Models of Monoids with Operations yang-2023-modular
Inspired by algebraic effects and the principle of notions of computations as monoids, we study a categorical framework for equational theories and models of monoids equipped with operations. The framework covers not only algebraic operations but also scoped and variable-binding operations. Appealingly, in this framework both theories and models can be modularly composed. Technically, a general monoid-theory correspondence is shown, saying that the category of theories of algebraic operations is equivalent to the category of monoids. Moreover, more complex forms of operations can be coreflected into algebraic operations, in a way that preserves initial algebras. On models, we introduce modular models of a theory, which can interpret abstract syntax in the presence of other operations. We show constructions of modular models (i) from monoid transformers, (ii) from free algebras, (iii) by composition, and (iv) in symmetric monoidal categories.
Cites 19 works (1 here)
With notes (1)
The essence of the Iterator pattern gibbons-2009-the
The Iterator pattern gives a clean interface for element-by-element access to a collection, independent of the collection’s shape. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating . Various existing functional models of iteration capture one or other of these aspects, but not both simultaneously. We argue that C. McBride and R. Paterson’s applicative functors (Applicative programming with effects, J. Funct. Program. , 18 (1): 1–13, 2008), and in particular the corresponding traverse operator, do exactly this, and therefore capture the essence of the Iterator pattern. Moreover, they do so in a way that nicely supports modular programming. We present some axioms for traversal, discuss modularity concerns and illustrate with a simple example, the wordcount problem.
External (18)
- Algebras for weighted search (2021)
- Functions and newtype wrappers for traversing Trees: rampion/tree-traversals (2019)
- A unified view of monadic and applicative non-determinism (2018)
- Notions of computation as monoids (2017)
- Breadth-first traversal (blog post, Patterns in Functional Programming) (2015)
- Free Applicative Functors (2014)
- Understanding idiomatic traversals backwards and forwards (2013)
- Circularity and Lambda Abstraction: From Bird to Pettorossi and Back (2013)
- An Investigation of the Laws of Traversals (2012)
- Constructing Applicative Functors (2012)
- A Gentle Introduction to Multi-stage Programming (2004)
- Breadth-first numbering: Lessons from a small exercise in algorithm design (2000)
- The under-appreciated unfold (1998)
- Linear-time breadth-first tree algorithms: An exercise in the arithmetic of folds and zips (1993)
- The Lambda Abstraction Strategy for Program Derivation (1989)
- Higher order generalization in program derivation (1987)
- Using circular programs to eliminate multiple traversals of data (1984)
- Code for "Breadth-First Traversal Via Staging"