TY - JOUR
T1 - Lenses for Web Data
AU - Rajkumar, Raghu
AU - Lindley, Sam
AU - Foster, Nate
AU - Cheney, James
PY - 2013
Y1 - 2013
N2 - 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.
AB - 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.
U2 - 10.14279/tuj.eceasst.57.879
DO - 10.14279/tuj.eceasst.57.879
M3 - Conference article
SN - 1863-2122
VL - 57
JO - Electronic Communications of the EASST
JF - Electronic Communications of the EASST
ER -