In this recipe, we created two snaplets for two data types: one for MyData, and another for MyApp. The following list shows the important aspects of creating and composing snaplets:
The MyData contains a list of strings. The field _someData starts with an underscore. This is done so that makeLenses (a Haskell Template function) can generate a lens for accessing and setting the field. More information about lenses is covered in Chapter 11, Working with Lens and Prism. Note that, in this recipe, we do not use lens as such, and the use of lenses is strictly restricted to only where Snap APIs demand.
The makeSnaplet function takes the snaplet name, description, and an optional data directory on the disc. Here we have used ...