Functional Reactive Programming

From HaskellWiki

Functional Reactive Programming (FRP) integrates time flow and compositional events into functional programming. This provides an elegant way to express computation in domains such as interactive animations, robotics, computer vision, user interfaces, and simulation.

Imagine you have a simple GUI label that displays the number of seconds
passed since program start. In an event-based model this is actually
quite a complicated task. You would have to create a label and update
it all the time using some form of timer/idle event. In Netwire you
write:

myLabel = time

Now let's say you want to have the same GUI, but the time should start
at 10 and pass twice as fast, so you actually want to display twice the
number of seconds passed plus 10:

myLabel = 10 + 2*time

Imagine you want to display the string "yes" in a label:

myLabel = "yes"

Now let's say you want to display "yes", when the space key is held down
and "no" otherwise:

myLabel = "yes" . keyDown Space <|> "no"

You want to display time while pressed and "Press space" while not:

myLabel = fmap show time . keyDown Space <|> "Press space"

You want to display "yes" every other second and "no" otherwise:

myLabel = "yes" . holdFor 1 (periodically 2) <|> "no"

Imagine doing that with event-based code.

Summary: FRP is about handling time-varying values like they were
regular values.