DanBurton / lens-family-th

Template Haskell to generate lenses for lens-family and lens-family-core
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

Provide the option to filter which leneses should be created #3

Closed DanBurton closed 12 years ago

DanBurton commented 12 years ago

Users may have reason to only want lenses for certain fields of a record. One suggestion was to only create lenses for fields that begin with an underscore. This could be generalized to work with any String -> Bool function, in case more flexibility is desired. This shouldn't be too hard to implement, though it does add a little more complexity to the implementation.

DanBurton commented 12 years ago

Another possibility is to allow the user to specify field names explicitly.

DanBurton commented 12 years ago

I've implemented both of these ideas: