Unifying graded and parameterised monads

01/28/2020
by   Dominic Orchard, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/10/2018

Factorisation systems for logical relations and monadic lifting in type-and-effect system semantics

Type-and-effect systems incorporate information about the computational ...
research
07/22/2020

Graded Hoare Logic and its Categorical Semantics

Deductive verification techniques, based on program logics (i.e., the fa...
research
07/11/2019

The Next 700 Relational Program Logics

We propose the first framework for defining relational program logics fo...
research
08/03/2021

Localisable Monads

Monads govern computational side-effects in programming semantics. They ...
research
09/07/2021

Abstraction Logic: The Marriage of Contextual Refinement and Separation Logic

Contextual refinement and separation logics are successful verification ...
research
07/29/2021

Doctrines, modalities and comonads

Doctrines are categorical structures very apt to study logics of differe...
research
04/04/2023

Gradual Typing for Effect Handlers

We present a gradually typed language, GrEff, with effects and handlers ...

Please sign up or login with your details

Forgot password? Click here to reset