Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2976002.2976010acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Functional reactive programming, refactored

Published: 08 September 2016 Publication History

Abstract

Functional Reactive Programming (FRP) has come to mean many things. Yet, scratch the surface of the multitude of realisations, and there is great commonality between them. This paper investigates this commonality, turning it into a mathematically coherent and practical FRP realisation that allows us to express the functionality of many existing FRP systems and beyond by providing a minimal FRP core parameterised on a monad. We give proofs for our theoretical claims and we have verified the practical side by benchmarking a set of existing, non-trivial Yampa applications running on top of our new system with very good results.

References

[1]
Reification of time in FRP. http://pchiusano.blogspot.co.uk/ 2010/07/reification-of-time-in-frp-is.html.
[2]
Haskanoid. github.com/ivanperez-keera/haskanoid.
[3]
Magic Cookies! https://play.google.com/store/apps/ details?id=uk.co.keera.games.magiccookies.
[4]
Pipes. https://hackage.haskell.org/package/pipes.
[5]
E. Bainomugisha, A. L. Carreton, T. v. Cutsem, S. Mostinckx, and W. d. Meuter. A survey on reactive programming. ACM Computing Surveys (CSUR), 45(4):52, 2013.
[6]
M. Bärenz, I. Perez, and H. Nilsson. Mathematical Properties of Monadic Stream Functions. http://cs.nott.ac.uk/~ixp/ papers/msfmathprops.pdf, 2016.
[7]
K. Claessen and J. Hughes. QuickCheck: a lightweight tool for random testing of Haskell programs. ACM Sigplan Notices, 46:53– 64, 2011.
[8]
A. Courtney and C. Elliott. Genuinely Functional User Interfaces. In Haskell Workshop, pages 41–69, Sept. 2001.
[9]
A. Courtney, H. Nilsson, and J. Peterson. The Yampa arcade. In Haskell Workshop, pages 7–18, 2003.
[10]
C. Elliott and P. Hudak. Functional Reactive Animation. In ACM SIGPLAN Notices, volume 32(8), pages 263–273, 1997.
[11]
J. Gibbons and G. Hutton. Proof Methods for Corecursive Programs. Fundamenta Informaticae Special Issue on Program Transformation, 66(4):353–366, April-May 2005.
[12]
J. Hughes. Generalising monads to arrows. Science of Computer Programming, 37(1):67 – 111, 2000.
[13]
J. Hughes. Programming with Arrows. In V. Vene and T. Uustalu, editors, 5th International School on Advanced Functional Programming, volume 3622, pages 73–129, 2005.
[14]
O. Kiselyov. Iteratees. In Functional and Logic Programming: 11th International Symposium, FLOPS 2012, pages 166–181, 2012.
[15]
S. Liang, P. Hudak, and M. Jones. Monad transformers and modular interpreters. In Symposium on Principles of programming languages, pages 333–343, 1995.
[16]
H. Liu, E. Cheng, and P. Hudak. Causal commutative arrows and their optimization. In ACM Sigplan Notices, volume 44, pages 35–46, 2009.
[17]
H. Nilsson. Dynamic Optimization for FRP using Generalized Algebraic Data Types. International Conference on Functional Programming, pages 54–65, 2005.
[18]
H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In Haskell Workshop, pages 51–64, 2002.
[19]
G. Patai. Efficient and compositional higher-order streams. In Functional and Constraint Logic Programming, pages 137–154. 2010.
[20]
R. Paterson. A new notation for arrows. In International Conference on Functional Programming, pages 229–240, Sept. 2001.
[21]
I. Perez and H. Nilsson. Bridging the GUI Gap with Reactive Values and Relations. In Haskell Symposium, pages 47–58, 2015.
[22]
K. C. Rovers. Functional model-based design of embedded systems with UniTi. PhD thesis, 2011.
[23]
N. Sculthorpe. Towards Safe and Efficient Functional Reactive Programming. PhD thesis, School of Computer Science, University of Nottingham, July 2011.
[24]
A. van der Ploeg. Monadic Functional Reactive Programming. In Haskell Symposium, pages 117–128, 2013.
[25]
Z. Wan and P. Hudak. Functional Reactive Programming from First Principles. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 242–252, 2000.
[26]
D. Winograd-Cort and P. Hudak. Wormholes: Introducing Effects to FRP. In Haskell Symposium, 2012.

Cited By

View all
  • (2024)Performance Analysis of Web Server Side Reactive Programming6GN for Future Wireless Networks10.1007/978-3-031-53404-1_9(96-108)Online publication date: 9-Mar-2024
  • (2024)Asynchronous Reactive Programming with Modal Types in HaskellPractical Aspects of Declarative Languages10.1007/978-3-031-52038-9_2(18-36)Online publication date: 10-Jan-2024
  • (2023)This Is Driving Me Loopy: Efficient Loops in Arrowized Functional Reactive ProgramsProceedings of the 16th ACM SIGPLAN International Haskell Symposium10.1145/3609026.3609726(3-17)Online publication date: 30-Aug-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
Haskell 2016: Proceedings of the 9th International Symposium on Haskell
September 2016
192 pages
ISBN:9781450344340
DOI:10.1145/2976002
© 2016 Association for Computing Machinery. ACM acknowledges that this contribution was authored or co-authored by an employee, contractor or affiliate of a national government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 08 September 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Haskell
  2. functional reactive programming
  3. monadic streams
  4. reactive program- ming
  5. stream programming

Qualifiers

  • Research-article

Conference

ICFP'16
Sponsor:

Acceptance Rates

Overall Acceptance Rate 57 of 143 submissions, 40%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)96
  • Downloads (Last 6 weeks)8
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Performance Analysis of Web Server Side Reactive Programming6GN for Future Wireless Networks10.1007/978-3-031-53404-1_9(96-108)Online publication date: 9-Mar-2024
  • (2024)Asynchronous Reactive Programming with Modal Types in HaskellPractical Aspects of Declarative Languages10.1007/978-3-031-52038-9_2(18-36)Online publication date: 10-Jan-2024
  • (2023)This Is Driving Me Loopy: Efficient Loops in Arrowized Functional Reactive ProgramsProceedings of the 16th ACM SIGPLAN International Haskell Symposium10.1145/3609026.3609726(3-17)Online publication date: 30-Aug-2023
  • (2023)The Beauty and Elegance of Functional Reactive AnimationProceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design10.1145/3609023.3609806(8-20)Online publication date: 30-Aug-2023
  • (2022)A Graph-Based Formal Semantics of Reactive Programming from First PrinciplesProceedings of the 24th ACM International Workshop on Formal Techniques for Java-like Programs10.1145/3611096.3611101(18-25)Online publication date: 7-Jun-2022
  • (2022)Modal FRP for all: Functional reactive programming without space leaks in HaskellJournal of Functional Programming10.1017/S095679682200013232Online publication date: 26-Dec-2022
  • (2021)Trampoline variables: a general method for state accumulation in reactive programmingProceedings of the 8th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems10.1145/3486605.3486787(27-40)Online publication date: 18-Oct-2021
  • (2021)Semantic Mapping from SysML to FRP: to Enable Executable and Verifiable Systems Design2021 IEEE International Systems Conference (SysCon)10.1109/SysCon48628.2021.9447075(1-7)Online publication date: 15-Apr-2021
  • (2020)The essence of live coding: change the program, keep the state!Proceedings of the 7th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems10.1145/3427763.3428312(2-14)Online publication date: 15-Nov-2020
  • (2020)Scripted signal functionsProceedings of the 13th ACM SIGPLAN International Symposium on Haskell10.1145/3406088.3409016(109-121)Online publication date: 27-Aug-2020
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media