# Eilenberg-Moore Monoids and Backtracking Monad Transformers

@inproceedings{Pirg2016EilenbergMooreMA, title={Eilenberg-Moore Monoids and Backtracking Monad Transformers}, author={Maciej Pir{\'o}g}, booktitle={MSFP}, year={2016} }

We develop an algebraic underpinning of backtracking monad transformers in the general setting of monoidal categories. As our main technical device, we introduce Eilenberg–Moore monoids, which combine monoids with algebras for strong monads. We show that Eilenberg–Moore monoids coincide with algebras for the list monad transformer (‘done right’) known from Haskell libraries. From this, we obtain a number of results, including the facts that the list monad transformer is indeed a monad, a… Expand

#### Topics from this paper

#### 9 Citations

A unified view of monadic and applicative non-determinism

- Computer Science
- Sci. Comput. Program.
- 2018

This article recovers a unified view of computational effects with non-determinism by extending monoids to near-semirings with both additive and multiplicative structure to generically define free constructions as well as a novel double Cayley representation. Expand

Backtracking with cut via a distributive law and left-zero monoids*

- Computer Science
- Journal of Functional Programming
- 2017

Two descriptions of the resulting monad are given: as the monad of free left-zero monoids, and as a composition via a distributive law of the list monad and the ‘unary idempotent operation’ monad. Expand

Equational Theories and Monads from Polynomial Cayley Representations

- Computer Science, Mathematics
- FoSSaCS
- 2019

CayMon, a tool that takes a polynomial as an input and generates the corresponding equational theory together with the two implementations of the induced monad in Haskell is introduced. Expand

Algebras for weighted search

- Computer Science
- Proc. ACM Program. Lang.
- 2021

Weighted search is an essential component of many fundamental and useful algorithms. Despite this, it is relatively under explored as a computational effect, receiving not nearly as much attention as… Expand

Distributive interaction of algebraic effects

- Computer Science
- 2017

This dissertation seeks to further the understanding of combining effects, especially from this more algebraic perspective, and considers in some detail a derivation of the geometrically convex monad, that is the combination of probabilistic and nondeterministic choice effects, called combined choice. Expand

List Objects with Algebraic Structure

- Mathematics, Computer Science
- FSCD
- 2017

This work introduces and study the notion of list object with algebraic structure, and provides a basic theory explicitly describing as an inductively defined object such free monoids with suitably compatiblegebraic structure in common practical situations. Expand

Denotational validation of higher-order Bayesian inference

- Computer Science
- Proc. ACM Program. Lang.
- 2018

A modular semantic account of Bayesian inference algorithms for probabilistic programming languages, as used in data science and machine learning, is presented and Kock's synthetic measure theory is used to emphasize the connection between the semantic manipulation and its traditional measure theoretic origins. Expand

Formally justified and modular Bayesian inference for probabilistic programs

- Computer Science
- 2019

This paper aims to demonstrate the efforts towards in-situ applicability of EMMARM, as to provide real-time information about concrete mechanical properties such as E-modulus and compressive strength. Expand

#### References

SHOWING 1-10 OF 50 REFERENCES

Monad transformers as monoid transformers

- Computer Science, Mathematics
- Theor. Comput. Sci.
- 2009

This work abstract and generalize from monads to monoids (in a monoidal category), and from monad transformers to monoid transformers, and opens the way for lifting of operations with applicability beyond monads. Expand

From monoids to near-semirings: the essence of MonadPlus and alternative

- Computer Science
- PPDP
- 2015

This article recovers the essence of these two type classes by extending monoids to near-semirings with both additive and multiplicative structure and enables us to generically define the free construction. Expand

Notions of computation as monoids*

- Computer Science, Mathematics
- Journal of Functional Programming
- 2017

This article gives conditions under which one can obtain free monoids and Cayley representations at the level of monoidal categories, and shows that their concretisation results in useful constructions for monads, applicative functors, and arrows. Expand

Backtracking, interleaving, and terminating monad transformers: (functional pearl)

- Computer Science
- ICFP '05
- 2005

Inspired by logic programming, the library provides constructs for fair disjunctions, fair conjunctions, conditionals, pruning, and an expressive top-level interface and it is shown that all these additional constructs can be generically and monadically realized using a single primitive msplit. Expand

Algebraic Operations and Generic Effects

- Mathematics, Computer Science
- Appl. Categorical Struct.
- 2003

This work defines the notion of generic effect and shows that to give a generic effect is equivalent to giving an algebraic operation, and shows how the usual monadic semantics of the computational λ-calculus extends uniformly to incorporate generic effects. Expand

The Coinductive Resumption Monad

- Computer Science, Mathematics
- MFPS
- 2014

This paper introduces generalised resumptions in a category-theoretic, coalgebraic context and shows their basic properties: they form a monad, they come equipped with a corecursion scheme in the sense of Adamek et al.'s notion of completely iterative monads (cims), and they enjoy a certain universal property. Expand

Deriving backtracking monad transformers

- Computer Science
- ICFP '00
- 2000

This work applies two fundamental techniques for deriving programs from their specification to derive a backtracking monad transformer that adds backtracking to an arbitrary monad. Expand

Monads and monoids on symmetric monoidal closed categories

- Mathematics
- 1973

part of a $/%monad A. In this note, we show that for a monad Tand a monoid A and a Y/'-natural transformation r -- (~ A --> T the following are equivalent (1) q is a Yf-monad map; (2) q is monoidal… Expand

Infinite trees and completely iterative theories: a coalgebraic view

- Computer Science, Mathematics
- Theor. Comput. Sci.
- 2003

It is proved that whenever an endofunctor H of a category has final coalgebras for all functors H(-) + X, then those coalgeBRas, TX, form a monad, which is a free completely iterative monad on H. Expand

Codensity and the ultrafilter monad

- Mathematics
- 2012

Even a functor without an adjoint induces a monad, namely, its codensity monad; this is subject only to the existence of certain limits. We clarify the sense in which codensity monads act as… Expand