Abstract
Functional Reactive Programming (FRP) is a way to program reactive systems in functional style, eliminating many of the problems that arise from imperative techniques. In this paper, we present an alternative FRP formulation that is based on the notion of a reactive computation: a monadic computation which may require the occurrence of external events to continue. A signal computation is a reactive computation that may also emit values. In contrast to signals in other FRP formulations, signal computations can end, leading to a monadic interface for sequencing signal phases. This interface has several advantages: routing is implicit, sequencing signal phases is easier and more intuitive than when using the switching combinators found in other FRP approaches, and dynamic lists require much less boilerplate code. In other FRP approaches, either the entire FRP expression is re-evaluated on each external stimulus, or impure techniques are used to prevent redundant re-computations. We show how Monadic FRP can be implemented straightforwardly in a purely functional way while preventing redundant re-computations.
- G. H. Cooper and S. Krishnamurthi. Embedding dynamic dataflow in a call-by-value language. In Proc. of the '06 European Symposium on Programming, pages 294--308, 2006. Google Scholar
Digital Library
- A. Courtney. Frappé: Functional reactive programming in Java. In Proc. of the '01 International Symposium of Pratical Aspects of Declarative Languages, March 2001. Google Scholar
Digital Library
- A. Courtney and C. Elliott. Genuinely functional user interfaces. In Proc. of the '01 Haskell Workshop, September 2001.Google Scholar
- A. Courtney, H. Nilsson, and J. Peterson. The Yampa arcade. In Proc. of the '03 Haskell Workshop, pages 7--18, Aug. 2003. Google Scholar
Digital Library
- C. Elliott. Functional implementations of continuous modeled animation. In Proc. of the 10th International Symposium on Principles of Declarative Programming, pages 284--299, 1998. Google Scholar
Digital Library
- C. Elliott. Push-pull functional reactive programming. In Proc. of the '09 Haskell Symposium, 2009. Google Scholar
Digital Library
- C. Elliott and P. Hudak. Functional reactive animation. In Proc. of the 1997 International Conference on Functional Programming, ICFP '1997, pages 163--173, June 1997. Google Scholar
Digital Library
- P. Hudak, A. Courtney, H. Nilsson, and J. Peterson. Arrows, robots, and functional reactive programming. In '02 Summer School on Advanced Functional Programming, pages 159--187, 2003.Google Scholar
Cross Ref
- J. Hughes. Generalising monads to arrows. Science of Computer Programming, 37(1-3):67--111, May 2000. Google Scholar
Digital Library
- A. S. A. Jeffrey. Causality for free!: Parametricity implies causality for functional reactive programs. In Programming Languages meets Program Verification, PLPV '13, 2013. Google Scholar
Digital Library
- P. Klint and A. van der Ploeg. A library for declarative resolution- independent 2d graphics. In Proc. of the '13 International Symposium on Practical Aspects of Declarative Languages, PADL '13, 2013.Google Scholar
Digital Library
- I. Maier and M. Odersky. Deprecating the Observer Pattern with Scala.react. Technical report, LAMP, 2012.Google Scholar
- C. Mcbride and R. Paterson. Applicative programming with effects. Journal of Functional Programming, 18(1):1--13, Jan. 2008. Google Scholar
Digital Library
- L. A. Meyerovich, A. Guha, J. Baskin, G. H. Cooper, M. Greenberg, A. Bromfield, and S. Krishnamurthi. Flapjax: a programming language for Ajax applications. In Proc. of the '09 Conference on Object oriented programming systems languages and applications, pages 1--20, 2009. Google Scholar
Digital Library
- H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In Proc. of the '02 Haskell Workshop, pages 51--64, Oct. 2002. Google Scholar
Digital Library
- R. Paterson. A new notation for arrows. In Proceedings of the '01 international conference on Functional programming, pages 229--240, 2001. ISBN 1-58113-415-0. Google Scholar
Digital Library
- J. Peterson, G. Hager, and P. Hudak. A language for declarative robotic programming. In Proc. of the 1999 International Conference on Robotics and Automation, 1999.Google Scholar
Cross Ref
- J. Peterson, P. Hudak, and C. Elliott. Lambda in Motion: Controlling robots with Haskell. In Proc. of the 1th International Workshop on Practical Aspects of Declarative Languages, PADL 1999, January 1999. Google Scholar
Digital Library
- J. Peterson, P. Hudak, A. Reid, and G. Hager. FVision: A declarative language for visual tracking. In Proc. of the '01 International Workshop on Practical Aspects of Declarative Languages, PADL '01, pages 304--321, Jan. 2001. Google Scholar
Digital Library
- N. Sculthorpe and H. Nilsson. Safe functional reactive programming through dependent types. In Proc. of the '09 International conference on Functional programming, ICFP '09, pages 23--34, 2009. Google Scholar
Digital Library
Index Terms
Monadic functional reactive programming
Recommendations
Monadic functional reactive programming
Haskell '13: Proceedings of the 2013 ACM SIGPLAN symposium on HaskellFunctional Reactive Programming (FRP) is a way to program reactive systems in functional style, eliminating many of the problems that arise from imperative techniques. In this paper, we present an alternative FRP formulation that is based on the notion ...
Fault tolerant functional reactive programming (functional pearl)
Highly critical application domains, like medicine and aerospace, require the use of strict design, implementation and validation techniques. Functional languages have been used in these domains to develop synchronous dataflow programming languages for ...
Functional reactive programming, refactored
Haskell 2016: Proceedings of the 9th International Symposium on HaskellFunctional 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 ...







Comments