Functional reactive programming
From Wikipedia, the free encyclopedia
Functional reactive programming (FRP) is a programming paradigm for reactive programming using the building blocks of functional programming.
The key traits of FRP are:[1]
- The concept of "behaviors" or "signals" which model values that vary over continuous time.
- The concept of "events" which have occurrences at finitely many points in time.
- A means to change the FRP system in response to events, generally termed "switching."
- The separation of evaluation details such as sampling rate from the reactive model.
An additional common but contentious trait is a notion of consistency when ordering events (not just within one stream). Variants include synchrony and glitch freedom.
The semantic model of FRP in side-effect free languages is typically in terms of continuous functions, and typically over time.[2] In contrast, integration with a host language that has side-effects is typically given in terms of data flow or dependency graphs by extending the typical operational semantics to manipulate and use them.
[edit] See also
- Flapjax, FRP implementation in JavaScript
- Elm (programming language), FRP language that compiles to HTML, CSS, and JavaScript
- Incremental computing
[edit] References
- ^ Conal Elliott and Paul Hudak, "Functional Reactive Animation", ICFP 1997
- ^ Antony Courtney and Conal Elliott, Genuinely Functional User Interfaces, 2001 Haskell Workshop
[edit] External links
- "What is Functional Reactive Programming?" An intro to FRP with live demos.
- Elm Programming language A functional reactive programming language that compiles to html/css/javascript.
- Haskell-related FRP research
- Bacon.js, a small FRP library for JavaScript. [1]
![]() |
This computer programming-related article is a stub. You can help Wikipedia by expanding it. |