Patrick Bahr IT University of Copenhagen

Push-Pull Modal Functional Reactive Programming

Lasse Faurby Klausen, Philip Kristian Møller Flyvholm and Patrick Bahr
Submitted for peer review, November 2025.

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 don't suffer from space leaks despite their high level of abstraction. However, so far these modal FRP languages only offer a data-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 framework and a case study of GUI applications.

Keywords: Functional Reactive Programming, Modal Types, Space Leaks