'      Safe-Inferred  !"#$ !"#$  !"#$1(C) 2012-2015 Nicolas Frisby, (C) 2015 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone%A NameBase paired with the name of its map functions. For example, when deriving Invariant2, its list of TyVarInfos might look like [(a, 'covMap1, 'contraMap1), (b, 'covMap2, 'contraMap2)].&*A wrapper around Name which only uses the ' (not the entire Name) to compare for equality. For example, if you had two Names a_123 and a_456, they are not equal as Names, but they are equal as NameBases.This is useful when inspecting type variables, since a type variable in an instance context may have a distinct Name from a type variable within an actual constructor declaration, but we'd want to treat them as the same if they have the same '8 (since that's what the programmer uses to begin with).(A representation of which  Invariant is being used.)BExpands all type synonyms in a type. Written by Dan Rosn in the  genifunctors package (licensed under BSD3).*A type-restricted version of +. This constrains the map functions that are autogenerated by Template Haskell to be the correct type, even if they aren't actually used in an invmap(2) expression. This is useful in makeInvmap(2), since a map function might have its type inferred as a instead of a -> b (which is clearly wrong).,#Extracts the name of a constructor.-KGenerate a list of fresh names with a common prefix, and numbered suffixes..CRemove any occurrences of a forall-ed type variable from a list of  TyVarInfos./#Extracts the name from a TyVarBndr.0#Extracts the kind from a TyVarBndr.1NReplace the Name of a TyVarBndr with one from a Type (if the Type has a Name).2)Applies a typeclass constraint to a type.3Checks to see if the last types in a data family instance can be safely eta- reduced (i.e., dropped), given the other types. This checks for three conditions: +All of the dropped types are type variables%All of the dropped types are distinct<None of the remaining types mention any of the dropped types4&Extract the Name from a type variable.5*Extract the NameBase from a type variable.66Peel off a kind signature from a Type (if it has one).7Is the given type a variable?8PIs the given type a type family constructor (and not a data family constructor)?9AAre all of the items in a list (which have an ordering) distinct?HThis uses Set (as opposed to nub) for better asymptotic time complexity.:=Does the given type mention any of the NameBases in the list?;DDoes an instance predicate mention any of the NameBases in the list?<xThe number of arrows that compose the spine of a kind signature (e.g., (* -> *) -> k -> * has two arrows on its spine).=)Construct a type via curried application.>7Fully applies a type constructor to its type variables.?HSplit an applied type into its individual components. For example, this: Either Int Char would split to this: [Either, Int, Char] @ESplit a type signature by the arrows on its spine. For example, this: (Int -> String) -> Char -> () would split to this: [Int -> String, Char, ()] A)Like uncurryType, except on a kind level.BMOf form k1 -> k2 -> ... -> kn, where k is either a single kind variable or *.?%&CD(EFG)HIJKLM*NOPQR,-./0123456789:;<=>?@ASBTUVWXYZ[\]^_`abcde;%&CD(EFG)HIJKLM*NOPQR,-./0123456789:;<=>?@ASBTUVWXYZ[\]^_`a;%&CD(FEG)HIJKLM*NOPQR,-./0123456789:;<=>?@ASBTUVWXYZ[\]^_`abcde1(C) 2012-2015 Nicolas Frisby, (C) 2015 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone Generates an FG instance declaration for the given data type or data family instance. Generates an EG instance declaration for the given data type or data family instance.1Generates a lambda expression which behaves like invmap (without requiring an F instance).1Generates a lambda expression which behaves like invmap2 (without requiring an E instance).f`Derive an Invariant(2) instance declaration (depending on the InvariantClass argument's value).gLGenerates an Invariant(2) instance declaration for a plain type constructor.hWGenerates an Invariant(2) instance declaration for a data family instance constructor.iGenerates a declaration defining the primary function corresponding to a particular class (invmap for Invariant and invmap2 for Invariant2).jfGenerates a lambda expression which behaves like invmap (for Invariant), or invmap2 (for Invariant2).kuGenerates a lambda expression for invmap(2) for the given constructors. All constructors must be from the same type.lEGenerates a lambda expression for invmap(2) for a single constructor.mMGenerates a lambda expression for invmap(2) for an argument of a constructor.nqGenerates a lambda expression for invmap(2) for an argument of a constructor, after expanding all type synonyms.oGenerates a lambda expression for invmap(2) for a specific type. The generated expression depends on the number of type variables.p0Extracts a plain type constructor's information.q*Extracts a data family name's information.r:Extracts a data family instance constructor's information.s|Deduces the Invariant(2) instance context, instance head, and eta-reduced type variables for a plain data type constructor.tDeduces the Invariant(2) instance context, instance head, and eta-reduced type variables for a data family instnce constructor.uRGiven a TyVarBndr, apply an Invariant(2) constraint to it, depending on its kind.v5Can a kind signature inhabit an Invariant constraint?:Invariant: Kind k1 -> k2 Invariant2: Kind k1 -> k2 -> k3wEither the given data type doesn't have enough type variables, or one of the type variables to be eta-reduced cannot realize kind *.xZThe data type has a DatatypeContext which mentions one of the eta-reduced type variables.ybThe data type has an existential constraint which mentions one of the eta-reduced type variables.zThe data type mentions one of the n eta-reduced type variables in a place other than the last nth positions of a data type in a constructor's field.{}One of the last type variables cannot be eta-reduced (see the canEtaReduce function for the criteria it would have to meet).fghijkl|mnop"Name of the plain type constructorqName of the data familyr,Name of the data family instance constructorstuvwxyz{fghijkl|mnopqrstuvwxyz{1(C) 2012-2015 Nicolas Frisby, (C) 2015 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottPortableNone{Wrap a } to be used as a member of  . Any  * -> * -> *; type parametric in both arguments permits an instance of  Invariant2.,Instances should satisfy the following laws: ~invmap2 id id id id = id invmap2 f2 f2' g2 g2' . invmap2 f1 f1' g1 g1' = invmap2 (f2 . f1) (f1' . f2') (g2 . g1) (g1' . g2') Wrap a ~# functor to be used as a member of .Wrap a  to be used as a member of .Any * -> *9 type parametric in the argument permits an instance of  Invariant.,Instances should satisfy the following laws: Ninvmap id id = id invmap f2 f2' . invmap f1 f1' = invmap (f2 . f1) (f1' . f2')Every  is also an  functor.Every ~ functor is also an  functor.Every  is also an   functor.Every } is also an   functor.from  GHC.GenericsC; genuinely relying on this instance likely requires writing your  instance by handfrom  GHC.Genericsfrom  GHC.Genericsfrom  GHC.Genericsfrom  GHC.Genericsfrom  GHC.Genericsfrom  GHC.Genericsfrom  GHC.Genericsfrom  GHC.Genericsfrom  GHC.Generics from the  transformers package from the tagged package from the  semigroups package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  contravariant package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors packagefrom Control.Applicativefrom Control.Applicative from the unordered-containers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the  transformers package from the tagged package from the stm package from the  semigroups package from the  semigroups package from the  semigroups package from the  semigroups package from the  semigroups package from the  semigroups package from the  semigroups package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  profunctors package from the  contravariant package from the  contravariant package from the  contravariant package from the  contravariant package from the  contravariant package from the  contravariant package from the  contravariant package from the  containers package from the  containers package from the  containers package from the  containers package from the  containers package from the  containers package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the  bifunctors package from the array packagefrom System.Console.GetOptfrom System.Console.GetOptfrom System.Console.GetOptfrom  Data.Proxyfrom  Data.Monoidfrom  Data.Monoidfrom  Data.Monoidfrom  Data.Monoidfrom Data.Functor.Identityfrom Control.Exceptionfrom  Control.Arrowfrom Control.Applicativefrom Control.Applicativefrom Control.Applicativefrom Control.Applicative                        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM-NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~454      !"#$%&'( invariant-0.2Data.Functor.InvariantData.Functor.Invariant.THPaths_invariant"Data.Functor.Invariant.TH.Internal bifunctors-5Data.Bifunctor.WrappedunwrapBifunctor WrapBifunctorWrappedBifunctorderiveInvariantderiveInvariant2 makeInvmap makeInvmap2WrappedProfunctorWrapProfunctorunwrapProfunctor Invariant2invmap2WrappedContravariantWrapContravariantunwrapContravariantWrappedFunctor WrapFunctor unwrapFunctor Invariantinvmap invmapFunctorinvmapContravariantinvmap2Bifunctorinvmap2ProfunctorcatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName TyVarInfoNameBasetemplate-haskellLanguage.Haskell.TH.SyntaxnameBaseInvariantClass expandSyn invmapConstbaseGHC.BaseconstconstructorName newNameListremoveForalledtvbNametvbKindreplaceTyVarName applyClass canEtaReduce varTToNamevarTToNameBaseunSigTisTyVar isTyFamily allDistinctmentionsNameBasepredMentionsNameBase numKindArrowsapplyTy applyTyCon unapplyTy uncurryTy uncurryKindcanRealizeKindStarChaingetNameSubst expandSynAppmkSubstsubstinvmapConstNameTableinvariantClassNameTableinvmapNameTable invmap2Const getNameBasefst3thd3lookup2 wellKindedcanRealizeKindStarcreateKindChaindistinctKindVars tvbToTypeinvariantPackageKeymkInvariantName_tcmkInvariantName_vinvariantTypeNameinvariant2TypeName invmapValNameinvmap2ValNameinvmapConstValNameinvmap2ConstValName errorValName$fShowNameBase $fOrdNameBase $fEqNameBase$fEnumInvariantClassderiveInvariantClassderiveInvariantPlainTyderiveInvariantDataFamInst invmapDecsmakeInvmapClassmakeInvmapForConsmakeInvmapForConmakeInvmapForArgmakeInvmapForArg'makeInvmapForType withTyCon withDataFamwithDataFamInstConcxtAndTypePlainTycxtAndTypeDataFamInstConapplyInvariantConstraintneedsConstraintderivingKindErrordatatypeContextErrorexistentialContextErroroutOfPlaceTyVarErroretaReductionErrormakeInvmapForArgsprofunctors-5.1.1Data.Profunctor.Unsafe Profunctorcontravariant-1.3.1.1Data.Functor.Contravariant ContravariantFunctorData.Bifunctor Bifunctor$fInvariant:.: GHC.GenericsGeneric1$fInvariantRec1$fInvariantPar1 $fInvariantM1$fInvariant2K1 $fInvariantK1$fInvariant:*:$fInvariant:+: $fInvariantU1 $fInvariantV1$fInvariant2Constant$fInvariant2Tagged$fInvariant2Arg$fInvariant2Copastro$fInvariant2Cotambara$fInvariant2Pastro$fInvariant2Tambara$fInvariant2Ran$fInvariant2Rift$fInvariant2Procompose$fInvariant2Codensity$fInvariant2Environment$fInvariant2Closure$fInvariant2Cayley$fInvariant2Forget$fInvariant2WrappedArrow$fInvariant2Costar$fInvariant2Star$fInvariant2Op$fInvariant2WrappedBifunctor$fInvariant2Tannen$fInvariant2Product$fInvariant2Joker$fInvariant2Flip$fInvariant2Clown$fInvariant2Biff$fInvariant2WrappedArrow0$fInvariant2Const$fInvariantHashMap$fInvariantSum$fInvariantReverse$fInvariantProduct$fInvariantConstant$fInvariantCompose$fInvariantWriterT$fInvariantWriterT0$fInvariantStateT$fInvariantStateT0$fInvariantReaderT$fInvariantRWST$fInvariantRWST0$fInvariantMaybeT$fInvariantListT$fInvariantIdentityT$fInvariantExceptT$fInvariantContT$fInvariantLift$fInvariantBackwards$fInvariantTagged$fInvariantSTM$fInvariantArg$fInvariantOption$fInvariantLast$fInvariantFirst$fInvariantMax$fInvariantMin$fInvariantNonEmpty$fInvariantCotambara$fInvariantTambara$fInvariantRan$fInvariantRift$fInvariantProcompose$fInvariantCodensity$fInvariantClosure$fInvariantForget$fInvariantWrappedArrow$fInvariantCostar$fInvariantStar$fInvariantComposeFC$fInvariantComposeCF$fInvariantCompose0 $fInvariantOp$fInvariantEquivalence$fInvariantComparison$fInvariantPredicate$fInvariantTree$fInvariantViewR$fInvariantViewL$fInvariantSeq$fInvariantMap$fInvariantIntMap$fInvariantWrappedBifunctor$fInvariantTannen$fInvariantJoker$fInvariantJoin$fInvariantFlip$fInvariantClown$fInvariantBiff$fInvariantArray$fInvariantOptDescr$fInvariantArgOrder$fInvariantArgDescr$fInvariantProxy$fInvariantLast0$fInvariantFirst0$fInvariantEndo$fInvariantDual$fInvariantIdentity$fInvariantHandler$fInvariantArrowMonad$fInvariantWrappedArrow0$fInvariantWrappedMonad$fInvariantZipList$fInvariantConst$fClosedWrappedProfunctor$fCochoiceWrappedProfunctor$fCostrongWrappedProfunctor$fChoiceWrappedProfunctor$fStrongWrappedProfunctor$fProfunctorWrappedProfunctor$fInvariantWrappedProfunctor$fInvariant2WrappedProfunctor$fInvariant2(,,,,)$fInvariant2(,,,)$fInvariant2(,,)$fInvariant2(,)$fInvariant2Either$fInvariant2(->)$fDecidableWrappedContravariant$fDivisibleWrappedContravariant#$fContravariantWrappedContravariant$fInvariantWrappedContravariant$fMonadPlusWrappedFunctor$fMonadWrappedFunctor$fAlternativeWrappedFunctor$fApplicativeWrappedFunctor$fFunctorWrappedFunctor$fInvariantWrappedFunctor$fInvariantErrorT$fInvariant(,,,,)$fInvariant(,,,)$fInvariant(,,)$fInvariant(,)$fInvariantEither$fInvariant(->)$fInvariantReadPrec$fInvariantReadP $fInvariantST$fInvariantST0 $fInvariantIO $fInvariant[]$fInvariantMaybe