Skip to main content

2020 | OriginalPaper | Buchkapitel

A Timed IO Monad

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

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 microseconds, 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.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Fußnoten
1
A careful reading of this code shows that the resulting specified duration of a timed lifted action is, more precisely, the actual duration of its execution minus the existing time drift right before its execution.
 
Literatur
1.
Zurück zum Zitat Archipoff, S., Janin, D.: Structured reactive programming with polymorphic temporal tiles. In: ACM Workshop on Functional Art, Music, Modeling and Design (FARM). ACM Press (2016) Archipoff, S., Janin, D.: Structured reactive programming with polymorphic temporal tiles. In: ACM Workshop on Functional Art, Music, Modeling and Design (FARM). ACM Press (2016)
2.
Zurück zum Zitat Colaço, J.-L., Girault, A., Hamon, G., Pouzet, M.: Towards a higher-order synchronous data-flow language. In: International Conference on Embedded Software (EMSOFT), pp. 230–239. ACM (2004) Colaço, J.-L., Girault, A., Hamon, G., Pouzet, M.: Towards a higher-order synchronous data-flow language. In: International Conference on Embedded Software (EMSOFT), pp. 230–239. ACM (2004)
3.
Zurück zum Zitat Elliott, C., Hudak, P.: Functional reactive animation. In: International Conference on Functional Programming (ICFP). ACM (1997) Elliott, C., Hudak, P.: Functional reactive animation. In: International Conference on Functional Programming (ICFP). ACM (1997)
4.
Zurück zum Zitat Elliott, C.M.: Push-pull functional reactive programming. In: Symposium on Haskell, pp. 25–36. ACM (2009) Elliott, C.M.: Push-pull functional reactive programming. In: Symposium on Haskell, pp. 25–36. ACM (2009)
5.
Zurück zum Zitat Giavitto, J.-L., Echeveste, J., Cont, A., Cuvillier, P.: Time, timelines and temporal scopes in the Antescofo DLS v1.0. In: International Computer Music Conference (ICMC) (2017) Giavitto, J.-L., Echeveste, J., Cont, A., Cuvillier, P.: Time, timelines and temporal scopes in the Antescofo DLS v1.0. In: International Computer Music Conference (ICMC) (2017)
6.
Zurück zum Zitat Halstead Jr., R.H.: Multilisp: a language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7(4), 501–538 (1985)CrossRef Halstead Jr., R.H.: Multilisp: a language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7(4), 501–538 (1985)CrossRef
8.
Zurück zum Zitat Hudak, P., Janin, D.: From out-of-time design to in-time production of temporal media. Research report, LaBRI, Université de Bordeaux (2015) Hudak, P., Janin, D.: From out-of-time design to in-time production of temporal media. Research report, LaBRI, Université de Bordeaux (2015)
9.
Zurück zum Zitat Hudak, P., Quick, D.: The Haskell School of Music : From Signals to Symphonies. Cambridge University Press, Cambridge (2018)CrossRef Hudak, P., Quick, D.: The Haskell School of Music : From Signals to Symphonies. Cambridge University Press, Cambridge (2018)CrossRef
11.
Zurück zum Zitat Janin, D.: An equational modeling of asynchronous concurrent programming. Technical report, LaBRI, Université de Bordeaux (2019) Janin, D.: An equational modeling of asynchronous concurrent programming. Technical report, LaBRI, Université de Bordeaux (2019)
12.
Zurück zum Zitat Janin, D.: Screaming in the IO monad. In: ACM Workshop on Functional Art, Music, Modeling and Design (FARM). ACM (2019) Janin, D.: Screaming in the IO monad. In: ACM Workshop on Functional Art, Music, Modeling and Design (FARM). ACM (2019)
13.
Zurück zum Zitat Krishnaswami, N.R.: Higher-order functional reactive programming without spacetime leaks. In: International Conference on Functional Programming (ICFP) (2013) Krishnaswami, N.R.: Higher-order functional reactive programming without spacetime leaks. In: International Conference on Functional Programming (ICFP) (2013)
14.
Zurück zum Zitat Mandel, L., Pouzet, M.: ReactiveML, a reactive extension to ML. In: International Symposium on Principles and Practice of Declarative Programming (PPDP). ACM (2005) Mandel, L., Pouzet, M.: ReactiveML, a reactive extension to ML. In: International Symposium on Principles and Practice of Declarative Programming (PPDP). ACM (2005)
17.
Zurück zum Zitat van der Ploeg, A., Claessen, K.: Practical principled FRP: forget the past, change the future, FRPNow! In: International Conference on Functional Programming (ICFP), pp. 302–314. ACM (2015) van der Ploeg, A., Claessen, K.: Practical principled FRP: forget the past, change the future, FRPNow! In: International Conference on Functional Programming (ICFP), pp. 302–314. ACM (2015)
18.
Zurück zum Zitat de Simone, R., Talpin, J.-P., Potop-Butucaru, D.: The synchronous hypothesis and synchronous languages. In: Embedded Systems Handbook. CRC Press (2005) de Simone, R., Talpin, J.-P., Potop-Butucaru, D.: The synchronous hypothesis and synchronous languages. In: Embedded Systems Handbook. CRC Press (2005)
19.
Zurück zum Zitat Wadler, P.: Comprehending monads. In: Conference on LISP and Functional Programming (LFP), New York. ACM (1990) Wadler, P.: Comprehending monads. In: Conference on LISP and Functional Programming (LFP), New York. ACM (1990)
20.
Zurück zum Zitat Winograd-Cort, D., Hudak, P.: Settable and non-interfering signal functions for FRP: how a first-order switch is more than enough. In: International Conference on Functional Programming (ICFP), pp. 213–225. ACM (2014) Winograd-Cort, D., Hudak, P.: Settable and non-interfering signal functions for FRP: how a first-order switch is more than enough. In: International Conference on Functional Programming (ICFP), pp. 213–225. ACM (2014)
Metadaten
Titel
A Timed IO Monad
verfasst von
David Janin
Copyright-Jahr
2020
DOI
https://doi.org/10.1007/978-3-030-39197-3_9