Functional reactive programming
From Wikipedia, the free encyclopedia
Functional reactive programming (FRP for short) is a programming paradigm for reactive programming using the building blocks of functional programming[1].
The key points of FRP are[2]:
- Input is viewed as a "behavior", or time-varying stream of events
- Continuous, time-varying values
- Time-ordered sequences of discrete events
- Time-varying values can be of higher orders
According to Peter van Roy:
Functional Reactive Programming is like functional programming except that each function can accept a stream of input values. If a new input value arrives on an argument, then the function is reevaluated with all the most recent input values and a new output value is created. This is a kind of dataflow programming. It can handle nondeterminism, so it is more expressive than declarative concurrency. In fact, it can be implemented with the declarative concurrent model extended with
WaitTwo. (This means that it is similar in expressiveness to concurrent logic programming!)
In contrast to this description, the semantic model for FRP given in research publications[3][4] is continuous (rather than stream-based) and deterministic (functions of time).
[edit] References
- ^ Henrik Nilsson. "Functional Reactive Programming Research". http://www.haskell.org/frp/. Retrieved 2006-10-17.
- ^ "usenet discussion". http://groups.google.com/group/flapjax/browse_thread/thread/2de4808143a5e751/5b1a6e4d6102e4e2?q=claird&rnum=5#5b1a6e4d6102e4e2.
- ^ Conal Elliott and Paul Hudak, "Functional Reactive Animation", ICFP 1997
- ^ Antony Courtney and Conal Elliott, Genuinely Functional User Interfaces, 2001 Haskell Workshop
[edit] See also
- Concepts, Techniques, and Models of Computer Programming
- Flapjax, an implementation for JavaScript
- Incremental computing
[edit] External links
- Haskell related FRP research
- FrTime, a PLT Scheme implementation
| This computer programming-related article is a stub. You can help Wikipedia by expanding it. |