Effectful Programming across Heterogeneous Computations -Work in Progress - Archive ouverte HAL Access content directly
Conference Papers Year :

Effectful Programming across Heterogeneous Computations -Work in Progress

(1) , (2, 3) , (4, 5)
1
2
3
4
5

Abstract

Monadic programming is a popular way to embed effectful computations in purely functional languages. In particular, the so-called free-monad comes with the promise of extensibility and modularity: computations are seen as syntax arising from a signature of operations they may perform. Popularized in a programming context, the approach is nowadays used for verification in proof assistants as well, as witnessed by frameworks such as FreeSpec or Interaction Trees. In this work in progress, we investigate the following question. Can we type each subcomputation with their minimal valid operation signature, and seamlessly combine all these monadic computations of different natures? Furthermore, can we leverage this additional precision in typing to derive monadic invariants for free? We answer positively by suggesting two simple ideas. First, a bind operation between computations living in distinct monads can be defined by transporting them through monad morphisms. Second, to give more structure to the monads we manipulate by indexing them by a semi-lattice as a means to automatically infer the adequate morphisms. We illustrate the benefits on a minimal Coq example: a computation interacting with a memory cell.
Fichier principal
Vignette du fichier
ordered.pdf (336.39 Ko) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-03886975 , version 1 (06-12-2022)

Identifiers

  • HAL Id : hal-03886975 , version 1

Cite

Jean Abou-Samra, Yannick Zakowski, Martin Bodin. Effectful Programming across Heterogeneous Computations -Work in Progress. JFLA 2023 - 34èmes Journées Francophones des Langages Applicatifs, Jan 2023, Praz-sur-Arly, France. pp.7-23. ⟨hal-03886975⟩
0 View
0 Download

Share

Gmail Facebook Twitter LinkedIn More