Patrick Bahr IT University of Copenhagen

Push-Pull Modal Functional Reactive Programming

Lasse Faurby Klausen, Philip Kristian Møller Flyvholm and Patrick Bahr
Symposium on Trends in Functional Programming 2026, to appear.

Abstract

Functional reactive programming (FRP) offers an expressive programming paradigm for building reactive systems in a functional style. In recent years, several FRP languages have introduced modal types to ensure that programs are free from space leaks despite their high level of abstraction. So far, these modal FRP languages only offer an event-driven (or push) execution model, where computation is driven by discrete events triggered by the environment. However, many applications benefit from a demand-driven (or pull) execution model, where computation is initiated by the consumer of data.

In this paper, we use Elliott's push-pull evaluation model to build an FRP library in a programming language with modal types. Additionally, we propose and implement several refinements to Elliott's push-pull model to extend its expressiveness. We evaluate our push-pull approach by implementing a GUI library and a case study of GUI applications

Keywords: Functional Reactive Programming, Modal Types, Space Leaks