Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | None |
- data LensRules = LensRules {
- _simpleLenses :: Bool
- _generateSigs :: Bool
- _generateClasses :: Bool
- _allowIsos :: Bool
- _fieldToDef :: [Name] -> Name -> [DefName]
- _classyLenses :: Name -> Maybe (Name, Name)
- data DefName
- = TopName Name
- | MethodName Name Name
- makeFieldOptics :: LensRules -> Name -> DecsQ
- makeFieldOpticsForDec :: LensRules -> Dec -> DecsQ
Documentation
LensRules | |
|
Name to give to generated field optics.
TopName Name | Simple top-level definiton name |
MethodName Name Name | makeFields-style class name and method name |
makeFieldOptics :: LensRules -> Name -> DecsQSource
Compute the field optics for the type identified by the given type name. Lenses will be computed when possible, Traversals otherwise.
makeFieldOpticsForDec :: LensRules -> Dec -> DecsQSource