Lenses for Web Data

Authors

  • Raghu Rajkumar Cornell University
  • Nate Foster Cornell University
  • Sam Lindley University of Edinburgh
  • James Cheney University of Edinburgh

DOI:

https://doi.org/10.14279/tuj.eceasst.57.879

Abstract

Putting data on the web typically involves implementing two transformations: one to convert the data into HTML, and another to parse modifications out of interactions with clients. Unfortunately, in current systems, these transformations are usually implemented using two separate functions—an approach that replicates functionality across multiple pieces of code, and makes programs difficult to write, reason about, and maintain. This paper presents a different approach: an abstraction based on formlets that makes it easy to bridge the gap between data stored on a server and values embedded in HTML forms. We introduce formlenses, which combine the advantages of formlets with those of lenses to provide compositional, bidirectional form-based views of Web data. We show that formlenses can be viewed as monoidal functors over lenses, analogously to formlets, which are applicative functors. Finally, we investigate the connection between linearity and bidirectional transformations and describe a translation from a linear pattern syntax into formlens combinators.

Downloads

Published

2014-01-21

How to Cite

[1]
R. Rajkumar, N. Foster, S. Lindley, and J. Cheney, “Lenses for Web Data”, eceasst, vol. 57, Jan. 2014.