English

Eilenberg--Moore Monoids and Backtracking Monad Transformers

Programming Languages 2016-08-22 v1 Software Engineering

Abstract

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 transformer, and an instance of the MonadPlus class. Finally, we construct an Eilenberg--Moore monoid of endomorphisms, which, via the codensity monad construction, yields a continuation-based implementation a la Hinze.

Cite

@article{arxiv.1604.01184,
  title  = {Eilenberg--Moore Monoids and Backtracking Monad Transformers},
  author = {Maciej Piróg},
  journal= {arXiv preprint arXiv:1604.01184},
  year   = {2016}
}

Comments

In Proceedings MSFP 2016, arXiv:1604.00384

R2 v1 2026-06-22T13:25:23.796Z