Effectful Programming across Heterogeneous Computations -Work in Progress - Archive ouverte HAL
Communication Dans Un Congrès Année : 2023

Effectful Programming across Heterogeneous Computations -Work in Progress

Résumé

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
Origine Fichiers produits par l'(les) auteur(s)

Dates et versions

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

Identifiants

  • HAL Id : hal-03886975 , version 1

Citer

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⟩
217 Consultations
231 Téléchargements

Partager

More