English

Layer by layer - Combining Monads

Logic in Computer Science 2018-10-08 v3

Abstract

We develop a method to incrementally construct programming languages. Our approach is categorical: each layer of the language is described as a monad. Our method either (i) concretely builds a distributive law between two monads, i.e. layers of the language, which then provides a monad structure to the composition of layers, or (ii) identifies precisely the algebraic obstacles to the existence of a distributive law and gives a best approximant language. The running example will involve three layers: a basic imperative language enriched first by adding non-determinism and then probabilistic choice. The first extension works seamlessly, but the second encounters an obstacle, which results in a best approximant language structurally very similar to the probabilistic network specification language ProbNetKAT.

Keywords

Cite

@article{arxiv.1712.01113,
  title  = {Layer by layer - Combining Monads},
  author = {Fredrik Dahlqvist and Louis Parlant and Alexandra Silva},
  journal= {arXiv preprint arXiv:1712.01113},
  year   = {2018}
}
R2 v1 2026-06-22T23:05:52.559Z