Looking at the code, it looks pretty simple. LensRules have a function lensField :: String -> Maybe String (which either gives a name for the lens or does not work). So you can make a function like
myMakeLenses = makeLensesWith $ lensRules & lensField .~ (\name -> Just (name ++ "L"))
and use this instead of makeLenses . Of course, you can parameterize your function to (++ "L") .
Or you can write it in a string if you like, for example.
makeLensesWith ?? ''Foo $ lensRules & lensField .~ (\name -> Just (name ++ "L"))
(Note that (??) is just an infix flip to pass arguments in the correct order. You can think of it as a “hole” in this case when the second argument is populated. And (&) just clicked ($) .)
shachaf
source share