Functional Reactive Programming

Functional Reactive Programming is an abstraction to define and reason about temporal systems. In FRP, systems transform time-varying inputs into time-varying outputs. The basic construct of FRP is that of a signal, notionally defined as a function from time to a value. The nature of time, how signals can be dfined and combined, and how they are evaluated during runtime, gives rise to a multitude of FRP variants and implementations.

Implementations

Yampa

Yampa is a domain-specific language embedded in Haskell for programming hybrid (mixed discrete-time and continuous-time) systems. Yampa systems are defined in terms of causal signal functions. Yampa was created by Henrik Nilsson and Antony Courtney around 2002-2003. Yampa is backend agnostic, you can connect it to any backend you want. Existing backends include SDL, SDL2, OpenGL, WX, HTML, HTML5 canvas, Gloss, diagrams, and Keera Hails. It comes with a testing library that allows you to use QuickCheck to test your games, and a time-travel debugger.

Yampa is actively maintained and updated, and is available on hackage: http://hackage.haskell.org/package/Yampa.

Haskanoid Video Peoplemon by Alex Stuart Space Invaders
Haskanoid, SDL cross-platform arkanoid. Peoplemon, a role playing game Yampa2048, a gloss board game

There are many programs written in Yampa, for example:

More can be found using the reverse dependency finder.

Dunai

Dunai is a domain-specific language embedded in Haskell for programming reactive systems. Dunai systems are defined in terms of causal monadic stream functions. Dunai was created by Ivan Perez and Manuel Baerenz during 2014-2016.

Installation

Dunai is available on hackage: http://hackage.haskell.org/package/dunai.

$ cabal sandbox init         # Optional, but recommended
$ cabal update
$ cabal install dunai

There is an implementation of Yampa on top of Dunai, called bearriver. The part included in bearriver is API compatible with Yampa. Bearriver is available on hackage: http://hackage.haskell.org/package/bearriver. You can install it with:

$ cabal sandbox init         # Optional, but recommended
$ cabal update
$ cabal install bearriver

Papers and technical reports

Talks