A Timed IO monad - Archive ouverte HAL Accéder directement au contenu
Communication Dans Un Congrès Année : 2020

A Timed IO monad

David Janin

Résumé

Programming with explicit timing information is often tedious and error prone. This is especially visible in music programming where, when played, the specified durations of notes and rests must be shortened in order to compensate the actual duration of all surrounding processing. In this paper, we develop the notion of timed extension of a monad that aims at relieving programmers from such a burden. We show how, under simple conditions, such extensions can be built, and how useful features of monad programming such as asynchronous concurrency with promises or data-flow programming with monadic streams can be uniformly lifted to the resulting timed programming framework. Even though presented and developed in the abstract, the notion of timed extension of a monad is nevertheless illustrated by two concrete instances: a default timed IO monad where programmers specify durations in mi-croseconds, and a musically timed IO monad, where programmers specify durations in number of beats, the underlying tempo, that is, the speed of the music in beats per minute, possibly changed whenever needed.
Fichier principal
Vignette du fichier
full.pdf (233.21 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-02389321 , version 1 (02-12-2019)

Identifiants

Citer

David Janin. A Timed IO monad. Practical Aspects of Declarative Languages (PADL), Jan 2020, New Orleans, United States. ⟨10.1007/978-3-030-39197-3_9⟩. ⟨hal-02389321⟩

Collections

CNRS
73 Consultations
386 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More