-- | Internal helper method for constructing partial set of lenses.
makeCustomLensesFiltered :: (String -> Bool) -> Name -> Q [Dec]
makeCustomLensesFiltered f = makeLensesWith customRules
  where
    customRules :: LensRules
    customRules = set lensField (fmap lensFieldName . mfilter f . Just)
                      defaultRules

-- | Create lenses for all fields of a given data type.
makeCustomLensesFiltered :: (String -> Bool) -> Name -> Q [Dec]
makeCustomLensesFiltered f = makeLensesWith customRules
  where
    customRules :: LensRules
    customRules = set lensField (fmap lensFieldName . mfilter f . Just)
                      defaultRules

-- | Create lenses for all fields of a given data type.
makeCustomLensesFiltered f = makeLensesWith customRules
  where
    customRules :: LensRules
    customRules = set lensField (fmap lensFieldName . mfilter f . Just)
                      defaultRules

-- | Create lenses for all fields of a given data type.