Functions are first class citizens: You can pass them, return them and store them in datastructures. • Functions tend to be pure. The evaluation of a function ONLY depends on its inputs. • Equational reasoning. • Embraces a data-oriented view. You are transforming data.
Elliot et al, 1998. Behavior • It’s a function of time ◦ type Behavior :: T -> a • Continuous time-varying values. • Sample rate independent. • Introduced for modelling animation/physics (velocity, gravity,etc) • Inefficient implementation. Led to space leaks.
Elliot et al, 1998. EventSource • Stream of timed values. ◦ type EventSource :: [(T,a)] where Tn < Tn+1 • Discrete time values. • It’s like you are in another dimension where you can see the past, present and future. The whole timeline. • Fits perfectly for heavily event oriented applications.
simultaneous, an intricately structured jewel that humans insist on viewing one edge at a time, when the whole design is visible in every facet.” Dr. Manhattan, Watchmen
a declarative way. • Time-varying values are first class citizen. • It allows you to use a data transformation style using mostly pure functions. • Side-effects are confined to one part of the application
• Push-based ◦ It can be implemented on top of event loops. • Infinite vs finite ◦ (Bacon.js) Streams are finite: They can start and end at arbitrary moments. ◦ (Elm) Streams are infinite: Stream are always “producing” values (Hot/Cold).
et al, 1998 • Push-Pull Functional Reactive Programming, Conal Elliot • Deprecating the observer pattern, Martin Odersky et al • React 2014: Erik Meijer - What does it mean to be Reactive? • “Controlling Time and Space: understanding the many formulations of FRP” by Evan Czaplicki (Elm creator) • Ryan Trinkle - Reflex: Practical Functional Reactive Programming (Haskell) • Lambda Jam 2014 - Conal Elliot - The Essence and Origins of Functional Reactive Programming