Patterns for computational effects arising from a monad or a comonad

Abstract : This paper presents equational-based logics for proving first order properties of programming languages involving effects. We propose two dual inference system patterns that can be instanciated with monads or comonads in order to be used for proving properties of different effects. The first pattern provides inference rules which can be interpreted in the Kleisli category of a monad and the coKleisli category of the associated comonad. In a dual way, the second pattern provides inference rules which can be interpreted in the coKleisli category of a comonad and the Kleisli category of the associated monad. The logics combine a 3-tier effect system for terms consisting of pure terms and two other kinds of effects called 'constructors/observers' and 'modifiers', and a 2-tier system for 'up-to-effects' and 'strong' equations. Each pattern provides generic rules for dealing with any monad (respectively comonad), and it can be extended with specific rules for each effect. The paper presents two use cases: a language with exceptions (using the standard monadic semantics), and a language with state (using the less standard comonadic semantics). Finally, we prove that the obtained inference system for states is Hilbert-Post complete.
Document type :
Reports
Complete list of metadatas

Cited literature [23 references]  Display  Hide  Download

https://hal.archives-ouvertes.fr/hal-00868831
Contributor : Jean-Guillaume Dumas <>
Submitted on : Monday, October 14, 2013 - 2:40:55 PM
Last modification on : Thursday, July 4, 2019 - 9:54:02 AM
Long-term archiving on : Wednesday, January 15, 2014 - 7:00:12 AM

Files

patternsmonads.pdf
Files produced by the author(s)

Identifiers

  • HAL Id : hal-00868831, version 2
  • ARXIV : 1310.0605

Collections

Citation

Jean-Guillaume Dumas, Dominique Duval, Jean-Claude Reynaud. Patterns for computational effects arising from a monad or a comonad. 2013. ⟨hal-00868831v2⟩

Share

Metrics

Record views

328

Files downloads

160