We begin with a functional reactive programming (FRP) model in which every program is viewed as a signal function that converts a stream of input values into a stream of output values. We observe that objects in the real world - such as a keyboard or sound card - can be thought of as signal functions as well. This leads us to a radically different approach to I/O: instead of treating real-world objects as being external to the program, we expand the sphere of influence of program execution to include them within. We call this virtualizing real-world objects. We explore how virtual objects (such as GUI widgets) and even non-local effects (such as debugging and random number generation) can be handled in the same way. The key to our approach is the notion of a resource type that assures that a virtualized object cannot be duplicated, and is safe. Resource types also provide a deeper level of transparency: by inspecting the type, one can see exactly what resources are being used. We use arrows, type classes, and type families to implement our ideas in Haskell, and the result is a safe, effective, and transparent approach to stream-based I/O. © 2012 Springer-Verlag.
CITATION STYLE
Winograd-Cort, D., Liu, H., & Hudak, P. (2012). Virtualizing real-world objects in FRP. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 7149 LNCS, pp. 227–241). https://doi.org/10.1007/978-3-642-27694-1_17
Mendeley helps you to discover research relevant for your work.