Functional Reactive Animation with Functions of Time
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,...
Saved in:
Published in | Journal of Information Processing Vol. 33; pp. 368 - 376 |
---|---|
Main Authors | , |
Format | Journal Article |
Language | English |
Published |
Information Processing Society of Japan
2025
|
Subjects | |
Online Access | Get full text |
Cover
Loading…
Summary: | 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. |
---|---|
ISSN: | 1882-6652 1882-6652 |
DOI: | 10.2197/ipsjjip.33.368 |