Generate overloaded field accessors based on field names which are
only prefixed with an underscore (e.g.
_name), not
additionally with the type name (e.g.
_fooName).
This might be the desired behaviour in case the
DuplicateRecordFields language extension is used in order to
get rid of the necessity to prefix each field name with the type name.
As an example:
data Foo a = Foo { _x :: Int, _y :: a }
newtype Bar = Bar { _x :: Char }
makeFieldsNoPrefix ''Foo
makeFieldsNoPrefix ''Bar
will create classes
class HasX s a | s -> a where
x :: Lens' s a
class HasY s a | s -> a where
y :: Lens' s a
together with instances
instance HasX (Foo a) Int
instance HasY (Foo a) a where
instance HasX Bar Char where
For details, see
classUnderscoreNoPrefixFields.
makeFieldsNoPrefix = makeLensesWith classUnderscoreNoPrefixFields