th-typegraph-0.35.1: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.Lens

Description

The HasStack monad used in MIMO to construct lenses that look deep into a record type. However, it does not involve the Path type mechanism, and is unaware of View instances and other things that modify the type graph. Lets see how it adapts.

Synopsis

Documentation

makeTypeGraphLenses :: forall m. (DsMonad m, MonadReaders TypeInfo m, MonadReaders TypeGraph m, MonadStates ExpandMap m) => m [Dec] Source #

Generate lenses to access the fields of the row types. Like Control.Lens.TH.makeLenses, but makes lenses for every field, and instead of removing the prefix '_' to form the lens name it adds the prefix "lens" and capitalizes the first letter of the field. The only reason for this function is backwards compatibility, makeLensesFor should be used instead.

lensNamePairs :: Quasi m => (Name -> Name -> Name -> (String, String)) -> Name -> m [(String, String)] Source #

Build the list of pairs used by makeLensesFor.