Quotients in monadic programming: Projective algebras are equivalent to coalgebras
Dusko Pavlovic, Peter-Michael Seidel

TL;DR
This paper explores the relationship between projective algebras and coalgebras in monadic programming, offering a new perspective on implementing quotient types and their categorical properties.
Contribution
It characterizes projective algebras in monadic programming and establishes an equivalence with coalgebras, enabling practical implementation of quotient types.
Findings
Projective algebras are equivalent to coalgebras for the induced comonad.
This equivalence facilitates implementing polymorphic quotients as coalgebras.
The work reveals new applications for quotient types and their categorical properties.
Abstract
In monadic programming, datatypes are presented as free algebras, generated by data values, and by the algebraic operations and equations capturing some computational effects. These algebras are free in the sense that they satisfy just the equations imposed by their algebraic theory, and remain free of any additional equations. The consequence is that they do not admit quotient types. This is, of course, often inconvenient. Whenever a computation involves data with multiple representatives, and they need to be identified according to some equations that are not satisfied by all data, the monadic programmer has to leave the universe of free algebras, and resort to explicit destructors. We characterize the situation when these destructors are preserved under all operations, and the resulting quotients of free algebras are also their subalgebras. Such quotients are called *projective*.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Formal Methods in Verification · semigroups and automata theory
