skip to main content
article

Back to the future: time travel in FRP

Published:07 September 2017Publication History
Skip Abstract Section

Abstract

Functional Reactive Programming (FRP) allows interactive applications to be modelled in a declarative manner using time-varying values. For practical reasons, however, operational constraints are often imposed, such as having a fixed time domain, time always flowing forward, and limiting the exploration of the past.

In this paper we show how these constraints can be overcome, giving local control over the time domain, the direction of time and the sampling step. We study the behaviour of FRP expressions when time flows backwards, and demonstrate how to synchronize subsystems running asynchronously and at different sampling rates. We have verified the practicality of our approach with two non-trivial games in which time control is central to the gameplay.

References

  1. CPR Baaij, M Kooijman, J Kuper, A Boeijink, and M Gerards. 2010. CLaSH: Structural descriptions of synchronous hardware using haskell. In EUROMICRO.Google ScholarGoogle Scholar
  2. Manuel Bärenz. 2017. Rhine - FRP with type-level clocks. http://www. manuelbaerenz.de/sites/default/files/Rhine.pdf (Draft).Google ScholarGoogle Scholar
  3. Antony Courtney. 2004. Modeling User Interfaces in a Functional Language. Ph.D. Dissertation. New Haven, CT, USA. AAI3125177. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Antony Courtney and Conal Elliott. 2001. Genuinely Functional User Interfaces. In Haskell Workshop. 41–69.Google ScholarGoogle Scholar
  5. Antony Courtney, Henrik Nilsson, and John Peterson. 2003. The Yampa arcade. In Proceedings of the 2003 ACM SIGPLAN workshop on Haskell. ACM, 7–18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Conal Elliott and Paul Hudak. 1997. Functional Reactive Animation. In ACM SIGPLAN Notices , Vol. 32(8). 263–273. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. John Hughes. 2000. Generalising monads to arrows. Science of Computer Programming 37, 1 (2000), 67 – 111. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jonathan Blow. 2008. Braid. http://braid-game.com/ . (2008).Google ScholarGoogle Scholar
  9. Adam Megacz Joseph. 2014. Generalized Arrows. Ph.D. Dissertation. EECS Department, University of California, Berkeley.Google ScholarGoogle Scholar
  10. Neelakantan R. Krishnaswami. 2013. Higher-order Functional Reactive Programming Without Spacetime Leaks. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming (ICFP ’13) . ACM, 221–232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Henrik Nilsson, Antony Courtney, and John Peterson. 2002. Functional reactive programming, continued. In Proceedings of the 2002 ACM SIGPLAN workshop on Haskell . ACM, 51–64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gergely Patai. 2010. Efficient and compositional higher-order streams. In Functional and Constraint Logic Programming . 137–154. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Ross Paterson. 2001. A New Notation for Arrows. In Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming (ICFP ’01) . ACM, 229–240. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ivan Perez, Manuel Bärenz, and Henrik Nilsson. 2016. Functional Reactive Programming, Refactored. In Proceedings of the 9th International Symposium on Haskell (Haskell 2016) . ACM, 33–44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Ivan Perez and Henrik Nilsson. 2017. Testing and Debugging Functional Reactive Programming. Proc. ACM Program. Lang. 1, ICFP, Article 2 (Sept. 2017), 27 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Atze van der Ploeg and Koen Claessen. 2015. Practical Principled FRP: Forget the Past, Change the Future, FRPNow!. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming . ACM, 302–314. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M Pouzet. 2001. Lucid Synchrone, version 2. Tutorial and reference manual. (2001).Google ScholarGoogle Scholar
  18. Kenneth Christian Rovers. 2011. Functional model-based design of embedded systems with UniTi . Ph.D. Dissertation.Google ScholarGoogle Scholar
  19. Ertugrul Söylemez. 2011. Netwire. https://github.com/esoeylemez/netwire . (2011).Google ScholarGoogle Scholar

Index Terms

  1. Back to the future: time travel in FRP

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!