Functional Reactive Programming

Functional reactive programming (FRP) is a programming paradigm for reactive programming using the building blocks of functional programming.

The key traits of FRP are:

  • The concept of "behaviors" or "signals" which model values which 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. 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.

Famous quotes containing the words functional and/or programming:

    Well designed, fully functional infant. Provides someone to live for as well as another mouth to feed. Produces cooing, gurgling and other adorable sounds. May cause similar behavior in nearby adults. Cries when hungry, sleepy or just because. Hand Wash with warm water and mild soap, then pat dry with soft cloth and talc. Internal mechanisms are self-cleaning... Two Genders: Male. Female. Five Colors: White. Black. Yellow. Red. Camouflage.
    Alfred Gingold, U.S. humorist. Items From Our Catalogue, “Baby,” Avon Books (1982)

    If there is a price to pay for the privilege of spending the early years of child rearing in the driver’s seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.
    Melinda M. Marshall (20th century)