Creating lenses

In this recipe, we will look at how we can define a generic property getter and setter. We will write a data type and we will write a generic type that will achieve both getting and setting a field inside the data type.