In this recipe, we will work with predefined lenses. We will use a library lens-aeson for dealing with JSON data. The aeson library is a popular library for parsing and writing JSON instances for the user-defined data. Often, we have to deal with JSON, and parse it on the fly to extract the desired data.
Working with predefined lenses
Getting ready
In this recipe, we will use the generic JSON parser provided by aeson, and then use lens-aeson to dig through the JSON to extract the data.
How to do it...
- Create a new project, working-with-aeson-lens, with a simple stack...