TY - JOUR
T1 - Unifying graded and parameterised monads
AU - Orchard, Dominic
AU - Wadler, Philip
AU - Eades, Harley
N1 - Publisher Copyright:
© D. Orchard and P. Wadler and H. Eades
PY - 2020/5/1
Y1 - 2020/5/1
N2 - Monads are a useful tool for structuring effectful features of computation such as state, non-determinism, and continuations. In the last decade, several generalisations of monads have been suggested which provide a more fine-grained model of effects by replacing the single type constructor of a monad with an indexed family of constructors. Most notably, graded monads (indexed by a monoid) model effect systems and parameterised monads (indexed by pairs of pre- and post-conditions) model program logics. This paper studies the relationship between these two generalisations of monads via a third generalisation. This third generalisation, which we call category-graded monads, arises by generalising a view of monads as a particular special case of lax functors. A category-graded monad provides a family of functors T f indexed by morphisms f of some other category. This allows certain compositions of effects to be ruled out (in the style of a program logic) as well as an abstract description of effects (in the style of an effect system). Using this as a basis, we show how graded and parameterised monads can be unified, studying their similarities and differences along the way.
AB - Monads are a useful tool for structuring effectful features of computation such as state, non-determinism, and continuations. In the last decade, several generalisations of monads have been suggested which provide a more fine-grained model of effects by replacing the single type constructor of a monad with an indexed family of constructors. Most notably, graded monads (indexed by a monoid) model effect systems and parameterised monads (indexed by pairs of pre- and post-conditions) model program logics. This paper studies the relationship between these two generalisations of monads via a third generalisation. This third generalisation, which we call category-graded monads, arises by generalising a view of monads as a particular special case of lax functors. A category-graded monad provides a family of functors T f indexed by morphisms f of some other category. This allows certain compositions of effects to be ruled out (in the style of a program logic) as well as an abstract description of effects (in the style of an effect system). Using this as a basis, we show how graded and parameterised monads can be unified, studying their similarities and differences along the way.
UR - http://www.scopus.com/inward/record.url?scp=85085680902&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85085680902&partnerID=8YFLogxK
U2 - 10.4204/EPTCS.317.2
DO - 10.4204/EPTCS.317.2
M3 - Conference article
AN - SCOPUS:85085680902
SN - 2075-2180
VL - 317
SP - 18
EP - 38
JO - Electronic Proceedings in Theoretical Computer Science, EPTCS
JF - Electronic Proceedings in Theoretical Computer Science, EPTCS
T2 - 8th Workshop on Mathematically Structured Functional Programming, MSFP 2020
Y2 - 25 April 2020
ER -