Functional reactive programming

From Wikipedia, the free encyclopedia

Jump to: navigation, search

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

[edit] See also

[edit] External links