Safe Haskell | None |
---|
Lens.Family.THCore
Description
The shared functionality behind Lens.Family.TH and Lens.Family2.TH.
- defaultNameTransform :: String -> String
- type LensTypeInfo = (Name, [TyVarBndr])
- type ConstructorFieldInfo = (Name, Strict, Type)
- deriveLenses :: (Name -> LensTypeInfo -> ConstructorFieldInfo -> Q [Dec]) -> (String -> String) -> Name -> Q [Dec]
Documentation
defaultNameTransform :: String -> StringSource
By default, if the field name begins with an underscore, then the underscore will simply be removed (and the new first character lowercased if necessary). Otherwise, the suffix Lens will be added.
type LensTypeInfo = (Name, [TyVarBndr])Source
Information about the larger type the lens will operate on.
type ConstructorFieldInfo = (Name, Strict, Type)Source
Information about the smaller type the lens will operate on.
Arguments
:: (Name -> LensTypeInfo -> ConstructorFieldInfo -> Q [Dec]) | the signature deriver |
-> (String -> String) | the name transformer |
-> Name | |
-> Q [Dec] |
The true workhorse of lens derivation. This macro is parameterized by a macro that derives signatures, as well as a function that transforms names.