!I@#^      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]None_ ^ optics-thProvides substitution for types_ optics-thPerform substitution for types` optics-thGProvides for the extraction of free type variables, and alpha renaming.a optics-thWhen performing substitution into this traversal you're not allowed to substitute in a name that is bound internally or you'll violate the b. laws, when in doubt generate your names with c.d optics-thHas a ef optics-thExtract (or modify) the e of somethingg optics-th Traverse free type variablesh optics-th Traverse free6 type variables paired with their kinds if applicable.i optics-th'Substitute using a map of names in for free type variables ^_`aghijklmNone  optics-th%Apply arguments to a type constructor optics-thApply arguments to a function optics-th-Construct a tuple type given a list of types. optics-th4Construct a tuple value given a list of expressions. optics-th3Construct a tuple pattern given a list of patterns. optics-th&Apply arguments to a type constructor. optics-thReturn e contained in a n. optics-th/Generate many new names from a given base name.  optics-th@Fill in kind variables using info from datatype type parameters.  optics-thTemplate Haskell wants type variables declared in a forall, so we find all free type variables in a given type and declare them.  optics-thThis function works like  J except that it takes a list of variables to exclude from quantification. optics-th base name  optics-thcount   NoneQBo optics-thNormalized constructor  optics-th Generate a p for each constructor of a data type. Isos generated when possible. Reviews are created for constructors with existentially quantified constructors and GADTs.e.g. Odata FooBarBaz a = Foo Int | Bar a | Baz Int Char makePrisms ''FooBarBaz  will create x_Foo :: Prism' (FooBarBaz a) Int _Bar :: Prism (FooBarBaz a) (FooBarBaz b) a b _Baz :: Prism' (FooBarBaz a) (Int, Char)  optics-th Generate a p for each constructor of a data type and combine them into a single class. No Isos are created. Reviews are created for constructors with existentially quantified constructors and GADTs.e.g. Udata FooBarBaz a = Foo Int | Bar a | Baz Int Char makeClassyPrisms ''FooBarBaz  will create class AsFooBarBaz s a | s -> a where _FooBarBaz :: Prism' s (FooBarBaz a) _Foo :: Prism' s Int _Bar :: Prism' s a _Baz :: Prism' s (Int,Char) _Foo = _FooBarBaz % _Foo _Bar = _FooBarBaz % _Bar _Baz = _FooBarBaz % _Baz instance AsFooBarBaz (FooBarBaz a) a  Generate an As class of prisms. Names are selected by prefixing the constructor name with an underscore. Constructors with multiple fields will construct Prisms to tuples of those fields.q optics-thIMain entry point into Prism generation for a given type constructor name. optics-thGenerate prisms for the given rs optics-thGenerate prisms for the given type, normalized constructors, and an optional name to be used for generating a prism class. This function dispatches between Iso generation, normal top-level prisms, and classy prisms.t optics-thrCompute the full type-changing Prism type given an outer type, list of constructors, and target constructor name.u optics-th1Construct either a Review or Prism as appropriatev optics-thConstruct prism expressionprism  reviewer remitterw optics-thConstruct an Iso expressioniso  reviewer remitterx optics-thConstruct a Review expressionunto ((x,y,z) -> Con x y z)y optics-th(Construct the review portion of a prism. ((x,y,z) -> Con x y z) :: b -> tz optics-th`Construct the remit portion of a prism. Pattern match only target constructor, no type changingh(s -> case s of Con x y z -> Right (x,y,z) _ -> Left s ) :: s -> Either s a{ optics-th6Pattern match all constructors to enable type-changingt(s -> case s of Con x y z -> Right (x,y,z) Other_n w -> Left (Other_n w) ) :: s -> Either t a| optics-th.Construct the remitter suitable for use in an }"((Con x y z) -> (x,y,z)) :: s -> a~ optics-thDConstruct the classy prisms class for a given type and constructors.class ClassName r  varsin type | r ->  varsin Type where topMethodName :: Prism' r Type conMethodName_n :: Prism' r conTypes_n conMethodName_n = topMethodName . conMethodName_n optics-thGConstruct the classy prisms instance for a given type and constructors.Ninstance Classname OuterType where topMethodName = id conMethodName_n = prism optics-thNormalize a single ) to its constructor name and field types. optics-thdCompute a prism's name by prefixing an underscore for normal constructors and period for operators. optics-th*Quantify all the free variables in a type.  optics-thType constructor name  optics-thType constructor name  optics-thgenerate top-level definitions v optics-thconstructors  optics-thtarget constructor   None &'>UVX_ optics-thTracks the field class ecs that have been created so far. We consult these so that we may avoid creating duplicate classes. optics-thThe optional rule to create a class and method around a monomorphic data type. If this naming convention is provided, it generates a "classy" lens. optics-th'Name to give to generated field optics. optics-th Simple top-level definition name optics-th+makeFields-style class name and method name optics-th<The rule to create function names of lenses for data fields.YAlthough it's sometimes useful, you won't need the first two arguments most of the time. optics-th*Rules to construct lenses for data fields. optics-th Allow LensTraversal (otherwise GetterFold)! optics-thAType Name -> Field Names -> Target Field Name -> Definition Names# optics-thCompute the field optics for the type identified by the given type name. Lenses will be computed when possible, Traversals otherwise. optics-thzCompute the field optics for a deconstructed datatype Dec When possible build an Iso otherwise build one optic per field.' optics-th9Build field optics as labels with a custom configuration. optics-thzCompute the field optics for a deconstructed datatype Dec When possible build an Iso otherwise build one optic per field. optics-thNormalized the Con type into a uniform positional representation, eliminating the variance between records, infix constructors, and normal constructors. optics-thCompute the positional location of the fields involved in each constructor for a given optic definition as well as the type of clauses to generate and the type to annotate the declaration with. optics-th/Compute the s t a b types given the outer type s} and the categorized field types. Left for fixed and Right for visited. These types are "raw" and will be packaged into an  shortly after creation. optics-thBuild the signature and definition for a single field optic. In the case of a singleton constructor irrefutable matches are used to enable the resulting lenses to be used on a bottom value. optics-thBuild an instance for a field. If the field s type contains any type families, will produce an equality constraint to avoid a type family application in the instance head. optics-thBBuild a getter clause that retrieves the field at the given index. optics-th&Build a clause that constructs an Iso. optics-thNBuild a lens clause that updates the field at the given index. When irref is 7 the value with be matched with an irrefutable pattern. optics-thFMake a lens match. Used for both lens and affine traversal generation. optics-th:Name of the data type that lenses are being generated for. optics-thBNames of the class and the main method it generates, respectively. optics-th:Name of the data type that lenses are being generated for. optics-thGNames of all fields (including the field being named) in the data type. optics-thName of the field being named. optics-thKName(s) of the lens functions. If empty, no lens is created for that field. optics-th(constructor name, field name, field type optics-th!for class instance?  optics-th!outer type  optics-th!normalized constructors  optics-th!target definition  optics-th8optic type, definition type, field count, target fields  optics-thOuter s type  optics-thOuter s type  optics-thOuter s type "! #$%&'"! #$%'&None>G0 optics-thbMonad for emitting top-level declarations as a side effect. We also track the set of field class eOs that have been created and consult them to avoid creating duplicate classes.- optics-th#Build field optics as instances of % class for use as overloaded labels.e.g. data Animal = Cat { animalAge :: Int , animalName :: String } | Dog { animalAge :: Int , animalAbsurd :: forall a b. a -> b } makeFieldLabels ''Animal  will create instance (k ~ A_Lens, a ~ Int, b ~ Int ) => LabelOptic "age" k Animal Animal a b where labelOptic = lensVL $ \f s -> case s of Cat x1 x2 -> fmap (\y -> Cat y x2) (f x1) Dog x1 x2 -> fmap (\y -> Dog y x2) (f x1) instance (k ~ An_AffineTraversal, a ~ String, b ~ String ) => LabelOptic "name" k Animal Animal a b where labelOptic = atraversalVL $ \point f s -> case s of Cat x1 x2 -> fmap (\y -> Cat x1 y) (f x2) Dog x1 x2 -> point (Dog x1 x2) which can be used as #age and #name+ with language extension OverloadedLabels.Note:I if you wonder about the form of instances or why there is no label for  animalAbsurd, check documentation for . # = ' 2 . optics-th?Derive field optics as labels, specifying explicit pairings of (fieldName, labelName).YIf you map multiple fields to the same label and it is present in the same constructor, b (or - for a read only version) will be generated.e.g. .. [("_foo", "fooLens"), ("baz", "lbaz")] ''Foo ., [("_barX", "bar"), ("_barY", "bar")] ''Bar / optics-thMake field optics as labels for all records in the given declaration quote. All record syntax in the input will be stripped off.e.g. YdeclareLenses [d| data Dog = Dog { name :: String, age :: Int } deriving Show |]  will create data Dog = Dog String Int deriving Show instance (k ~ A_Lens, ...) => LabelOptic "name" k Dog Dog ... instance (k ~ A_Lens, ...) => LabelOptic "age" k Dog Dog ... 0 optics-th Similar to . , but takes a declaration quote.2 optics-thRules for generation of 2 intances for use with OverloadedLabels. Same as : , but uses [.Note:[ if you don't want to prefix field names with the full name of the data type, you can use ] instead.3 optics-th Construct a  value for generating E instances using the given map from field names to definition names.4 optics-thQBuild field optics as top level functions with a sensible default configuration.e.g. data Animal = Cat { _age ::  , _name ::  } | Dog { _age :: 3 , _absurd :: forall a b. a -> b } 4 ''Animal  will create absurd :: forall a b. AffineFold Animal (a -> b) absurd = afolding $ \s -> case s of Cat _ _ -> Nothing Dog _ x -> Just x age :: Lens' Animal Int age = lensVL $ \f s -> case s of Cat x1 x2 -> fmap (\y -> Cat y x2) (f x1) Dog x1 x2 -> fmap (\y -> Dog y x2) (f x1) name :: AffineTraversal' Animal String name = atraversalVL $ \point f s -> case s of Cat x1 x2 -> fmap (\y -> Cat x1 y) (f x2) Dog x1 x2 -> point (Dog x1 x2) 4 = 6 : 5 optics-th5Derive field optics, specifying explicit pairings of (fieldName, opticName).YIf you map multiple fields to the same optic and it is present in the same constructor, b (or - for a read only version) will be generated.e.g. 5. [("_foo", "fooLens"), ("baz", "lbaz")] ''Foo 5, [("_barX", "bar"), ("_barY", "bar")] ''Bar 6 optics-th/Build field optics with a custom configuration.7 optics-thwMake field optics for all records in the given declaration quote. All record syntax in the input will be stripped off.e.g. 3declareLenses [d| data Foo = Foo { fooX, fooY ::  } deriving  |]  will create data Foo = Foo   deriving  fooX, fooY ::  Foo Int 8 optics-th Similar to 5 , but takes a declaration quote.9 optics-th7 with custom .: optics-thJRules for making read-write field optics as top-level functions. It uses W.; optics-th Construct a d value for generating top-level functions using the given map from field names to definition names.< optics-thZMake lenses and traversals for a type, and create a class when the type has no arguments.e.g. !data Foo = Foo { _fooX, _fooY ::  } < ''Foo  will create Qclass HasFoo c where foo :: Lens' c Foo fooX :: Lens' c Int fooY :: Lens' c Int fooX = foo % fooX fooY = foo % fooY instance HasFoo Foo where foo = lensVL id fooX = lensVL $ \f s -> case s of Foo x1 x2 -> fmap (\y -> Foo y x2) (f x1) fooY = lensVL $ \f s -> case s of Foo x1 x2 -> fmap (\y -> Foo x1 y) (f x2) < = 6 A = optics-thmMake lenses and traversals for a type, and create a class when the type has no arguments. Works the same as < except that (a) it expects that record field names do not begin with an underscore, (b) all record fields are made into lenses, and (c) the resulting lens is prefixed with an underscore.> optics-th`Derive lenses and traversals, using a named wrapper class, and specifying explicit pairings of (fieldName, traversalName).Example usage: >= "HasFoo" "foo" [("_foo", "fooLens"), ("bar", "lbar")] ''Foo ? optics-thFor each record in the declaration quote, make lenses and traversals for it, and create a class when the type has no arguments. All record syntax in the input will be stripped off.e.g. 3declareClassy [d| data Foo = Foo { fooX, fooY ::  } deriving  |]  will create data Foo = Foo   deriving  class HasFoo t where foo :: ' t Foo instance HasFoo Foo where foo =  fooX, fooY :: HasFoo t =>  t  @ optics-th Similar to > , but takes a declaration quote.A optics-th?Rules for making lenses and traversals that precompose another .B optics-thA  used by =.C optics-th?Rules for making lenses and traversals that precompose another w using a custom function for naming the class, main class method, and a mapping from field names to definition names.D optics-th$Generate overloaded field accessors.e.g data Foo a = Foo { _fooX :: ,, _fooY :: a } newtype Bar = Bar { _barX :: % } makeFields ''Foo makeFields ''Bar  will create class HasX s a | s -> a where x :: Lens' s a instance HasX (Foo a) Int where x = lensVL $ \f s -> case s of Foo x1 x2 -> fmap (\y -> Foo y x2) (f x1) class HasY s a | s -> a where y :: Lens' s a instance HasY (Foo a) a where y = lensVL $ \f s -> case s of Foo x1 x2 -> fmap (\y -> Foo x1 y) (f x2) instance HasX Bar Char where x = lensVL $ \f s -> case s of Bar x1 -> fmap (\y -> Bar y) (f x1) For details, see S.  makeFields = 6 G E optics-thkGenerate 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).1This might be the desired behaviour in case the DuplicateRecordFieldso 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 :: &, _y :: a } newtype Bar = Bar { _x :: 5 } 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 Uinstance HasX (Foo a) Int instance HasY (Foo a) a where instance HasX Bar Char where For details, see T. makeFieldsNoPrefix = 6 T F optics-th  declareFields = 9 GH optics-th Generate a ( for each constructor of each data type.e.g. ^declarePrisms [d| data Exp = Lit Int | Var String | Lambda{ bound::String, body::Exp } |]  will create Ndata Exp = Lit Int | Var String | Lambda { bound::String, body::Exp } _Lit ::  Exp Int _Var ::  Exp String _Lambda ::  Exp (String, Exp) I optics-thMGenerate "simple" optics even when type-changing optics are possible. (e.g.  instead of )J optics-thJIndicate whether or not to supply the signatures for the generated lenses.Disabling this can be useful if you want to provide a more restricted type signature or if you want to supply hand-written haddocks.K optics-th"Generate "updateable" optics when . When , (affine) folds will be generated instead of (affine) traversals and getters will be generated instead of lenses. This mode is intended to be used for types with invariants which must be maintained by "smart" constructors.L optics-thwGenerate optics using lazy pattern matches. This can allow fields of an undefined value to be initialized with lenses: 8data Foo = Foo {_x :: Int, _y :: Bool} deriving Show 6 (: & L .~ True) ''Foo  9> undefined & x .~ 8 & y .~ True Foo {_x = 8, _y = True} The downside of this flag is that it can lead to space-leaks and code-size/compile-time increases when generated for large records. By default this flag is turned off, and strict optics are generated.LWhen using lazy optics the strict optic can be recovered by composing with : $strictOptic = equality' % lazyOptic M optics-thZCreate the class if the constructor if generated lenses would be type-preserving and the O rule matches.N optics-th3 to access the convention for naming fields in our .O optics-th1 to access the option for naming "classy" lenses.P optics-thcField rules for fields without any prefix. Useful for generation of field labels when paired with DuplicateRecordFieldsG language extension so that no prefixes for field names are necessary.R optics-th#Field rules for fields in the form  _prefix_fieldname S optics-th#Field rules for fields in the form % prefixFieldname or _prefixFieldname GIf you want all fields to be lensed, then there is no reason to use an _@ before the prefix. If any of the record fields leads with an _' then it is assume a field without an _ should not have a lens created.Note: The prefix must be the same as the typename (with the first letter lowercased). This is a change from lens versions before lens 4.5. If you want the old behaviour, use 6 UT optics-th#Field rules for fields in the form  _fieldname ( (the leading underscore is mandatory).Note: The primary difference to S is that for classUnderscoreNoPrefixFieldst the field names are not expected to be prefixed with the type name. This might be the desired behaviour when the DuplicateRecordFields extension is enabled.U optics-thField rules fields in the form % prefixFieldname or _prefixFieldname I If you want all fields to be lensed, then there is no reason to use an _? before the prefix. If any of the record fields leads with an _& then it is assume a field without an _ should not have a lens created. Note that prefix may be any string of characters that are not uppercase letters. (In particular, it may be arbitrary string of lowercase letters and numbers) This is the behavior that G had in lens 4.4 and earlier.V optics-thA [ that leaves the field name as-is. Useful for generation of field labels when paired with DuplicateRecordFieldsG language extension so that no prefixes for field names are necessary.W optics-thA p that strips the _ off of the field name, lowercases the name, and skips the field if it doesn't start with an '_'.X optics-th Create a  from explicit pairings of (fieldName, lensName).Y optics-th Create a 3 from a mapping function. If the function returns []#, it creates no lens for the field.Z optics-thA  for R.[ optics-thA  for S.\ optics-thA  for T.] optics-thA  for U. optics-thLTraverse each data, newtype, data instance or newtype instance declaration.3 optics-th (Field name, Label name); optics-th (Field name, Optic name)C optics-th-Type Name -> Maybe (Class Name, Method Name)  optics-th (Field Name, Method Name)Y optics-thA function that maps a  fieldName to lensNames.; '-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\];-.'/0123456789:;<=>?@ABCDEFG HIJKLMNOPQRSTUVWXYZ[\]      !!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnolmpqrstuvwxlmyzi{|lm}~ilmiiiii{i$optics-th-0.3-CLR89EncPAWKromiQFIzSqOptics.TH.Internal.UtilsOptics.TH.Internal.SumOptics.TH.Internal.Product Optics.TH#Language.Haskell.TH.Optics.InternalControl.Lens.TypePrismappsTappsE1toTupleTtoTupleEtoTuplePconAppsTbndrNamenewNameseqSubst addKindVars quantifyType quantifyType' inlinePragma makePrismsmakeClassyPrismsmakePrismLabels makeDecPrisms$fHasTypeVarsNCon$fEqNConHasFieldClasses ClassyNamerDefNameTopName MethodName FieldNamer LensRules _simpleLenses _generateSigs_generateClasses _allowIsos _allowUpdates _lazyPatterns _fieldToDef _classyLensesmakeFieldOpticsmakeFieldOpticsForDecmakeFieldOpticsForDec'makeFieldLabelsForDecmakeFieldLabelsWith$fShowOpticType$fShowOpticStab $fShowDefName $fEqDefName $fOrdDefNamemakeFieldLabelsmakeFieldLabelsFordeclareFieldLabelsdeclareFieldLabelsFordeclareFieldLabelsWithfieldLabelsRulesfieldLabelsRulesFor makeLenses makeLensesFormakeLensesWith declareLensesdeclareLensesFordeclareLensesWith lensRules lensRulesFor makeClassy makeClassy_ makeClassyFor declareClassydeclareClassyFor classyRules classyRules_classyRulesFor makeFieldsmakeFieldsNoPrefix declareFieldsdefaultFieldRules declarePrisms simpleLensesgenerateSignaturesgenerateUpdateableOpticsgenerateLazyPatterns createClass lensField lensClassnoPrefixFieldLabelsabbreviatedFieldLabelsunderscoreFieldscamelCaseFieldsclassUnderscoreNoPrefixFieldsabbreviatedFields noPrefixNamerunderscoreNoPrefixNamerlookingupNamer mappingNamerunderscoreNamercamelCaseNamerclassUnderscoreNoPrefixNamerabbreviatedNamer SubstType substType HasTypeVars typeVarsEx&optics-core-0.3-AO2AfMctsnL4QbkxVQq6eFOptics.Traversal Traversaltemplate-haskellLanguage.Haskell.TH.SyntaxnewNameHasNameNamenametypeVarstypeVarsKinded substTypeVars_FamilyI_ClosedTypeFamilyD_OpenTypeFamilyD_ForallT TyVarBndrNCon Optics.Prism makePrisms'DecmakeConsPrismscomputePrismTypemakeConOpticExpmakeConPrismExp makeConIsoExpmakeConReviewExp makeReviewermakeSimpleRemittermakeFullRemittermakeIsoRemitter Optics.IsoIsomakeClassyPrismClassmakeClassyPrismInstance normalizeConCon prismNameclosemakeFieldOpticsForDatatypemakeFieldLabelsForDatatypenormalizeConstructor buildScaffold buildStab OpticStabmakeFieldOpticmakeFieldInstancemakeGetterClause makeIsoClausemakeLensClauseghc-prim GHC.TypesTrue makeLensMatchmakeClassyDrivermakeClassyClassmakeClassyInstanceDeclareOptics.Internal.Optic LabelOptic Optics.FoldFoldIntbaseGHC.BaseStringGHC.ShowShow Optics.LensLens'idLensCharPrism'False equality'traverseDataAndNewtype