Abstract
A lens is an optical device which refracts light. Properly adjusted, it can be used to project sharp images of objects onto a screen—a principle underlying photography as well as human vision. Striving for clarity, we shift our focus to lenses as abstractions for bidirectional programming. By means of standard mathematical terminology as well as intuitive properties of bidirectional programs, we observe different ways to characterize lenses and show exactly how their laws interact. Like proper adjustment of optical lenses is essential for taking clear pictures, proper organization of lens laws is essential for forming a clear picture of different lens classes. Incidentally, the process of understanding bidirectional lenses clearly is quite similar to the process of taking a good picture.
By showing that it is exactly the backward computation which defines lenses of a certain standard class, we provide an unusual perspective, as contemporary research tends to focus on the forward computation.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Bird, R.S.: Introduction to Functional Programming Using Haskell. Prentice-Hall (1998). http://www.cs.ox.ac.uk/publications/books/functional/
Foster, J.: Bidirectional programming languages. Ph.D. thesis. University of Pennsylvania, December 2009
Foster, J.N., Greenwald, M.B., Moore, J.T., Pierce, B.C., Schmitt, A.: Combinators for bidirectional tree transformations: a linguistic approach to the view-update problem. ACM Trans. Program. Lang. Syst. 29(3), 17 (2007)
Acknowledgements
We appreciate the help of Janis Voigtländer, Jeremy Gibbons, Alcino Cunha, Nikita Danilenko, Insa Stucke, and José Nuno Oliveira who have looked at drafts of our picture.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Fischer, S., Hu, Z., Pacheco, H. (2015). A Clear Picture of Lens Laws. In: Hinze, R., Voigtländer, J. (eds) Mathematics of Program Construction. MPC 2015. Lecture Notes in Computer Science(), vol 9129. Springer, Cham. https://doi.org/10.1007/978-3-319-19797-5_10
Download citation
DOI: https://doi.org/10.1007/978-3-319-19797-5_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-19796-8
Online ISBN: 978-3-319-19797-5
eBook Packages: Computer ScienceComputer Science (R0)