© Stefania Loredana Nita and Marius Mihailescu 2019
Stefania Loredana Nita and Marius MihailescuHaskell Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4507-1_20

20. Lens

Stefania Loredana Nita1  and Marius Mihailescu1
(1)
Bucharest, Romania
 

In this chapter, you will learn about a particular type of functional reference. First, let’s see define functional reference: reference means you can access and/or modify part of the values, and functional means that the flexibility and composability of functions are assured while accessing these parts.

Lenses are a type of functional reference, implemented in Haskell by the lens library , that represent a first-class getter and setter. With a lens, you can do the following things:
  • Access a subpart

  • Alter ...

Get Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.