Skip to main content

A Clear Picture of Lens Laws

Functional Pearl

  • Conference paper
  • First Online:
Mathematics of Program Construction (MPC 2015)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9129))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://hackage.haskell.org/package/lens.

  2. 2.

    http://hackage.haskell.org/package/fclabels.

References

  1. Bird, R.S.: Introduction to Functional Programming Using Haskell. Prentice-Hall (1998). http://www.cs.ox.ac.uk/publications/books/functional/

  2. Foster, J.: Bidirectional programming languages. Ph.D. thesis. University of Pennsylvania, December 2009

    Google Scholar 

  3. 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)

    Article  MATH  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Sebastian Fischer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics