Journal of Information Processing
Online ISSN : 1882-6652
ISSN-L : 1882-6652
 
Functional Reactive Animation with Functions of Time
Katsuhiro Ueno, Haru Karato
Author information
JOURNAL FREE ACCESS

2025 Volume 33 Pages 368-376

Details
Abstract

Motivated by the goal of making functional reactive programming straightforward and accessible even to beginners in functional programming, this paper proposes a compact yet novel framework that allows users to write reactive animations simply as compositions of functions of time. In this framework, any value that changes over time—including the entire animation and external states such as keyboard and mouse input—is represented by a function of time, making its time dependency explicit. Since time-varying values are ordinary functions, they are naturally composed using standard language constructs without requiring specialized combinators, in contrast to Elliott and Hudak's functional reactive programming and its successors. To encapsulate external states as declarative functions of time, the framework defines a time value as a dynamically extensible record consisting of values observed from the external world at specific moments. A field selector of such records has a function type of time and hence represents a time-varying value. The framework provides two primitives to organize the records: event for creating an external event sources and stream for accumulating past values. This paper describes the framework's design and implementation in Standard ML and demonstrates its descriptive power through examples.

Content from these authors
© 2025 by the Information Processing Society of Japan
Previous article Next article
feedback
Top