m     Safe  !"#$% !"#$%  !"#$%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.0#Extracts the name from a TyVarBndr.1#Extracts the kind from a TyVarBndr.2NReplace the Name of a TyVarBndr with one from a Type (if the Type has a Name).3)Applies a typeclass constraint to a type.4Checks 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 types5&Extract the Name from a type variable.6*Extract the NameBase from a type variable.76Peel off a kind signature from a Type (if it has one).8Is the given type a variable?9PIs the given type a type family constructor (and not a data family constructor)?:AAre 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] AESplit a type signature by the arrows on its spine. For example, this: (Int -> String) -> Char -> () would split to this: [Int -> String, Char, ()] B)Like uncurryType, except on a kind level.CMOf form k1 -> k2 -> ... -> kn, where k is either a single kind variable or *.?&'DE)FGH*IJKLMN+OPQRS-./0123456789:;<=>?@ABTCUVWXYZ[\]^_`abcdef;&'DE)FGH*IJKLMN+OPQRS-./0123456789:;<=>?@ABTCUVWXYZ[\]^_`ab;&'DE)FGH*IJKLMN+OPQRS-./0123456789:;<=>?@ABTCUVWXYZ[\]^_`abcdef1(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 GG 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 G instance).g`Derive an Invariant(2) instance declaration (depending on the InvariantClass argument's value).hGenerates a declaration defining the primary function corresponding to a particular class (invmap for Invariant and invmap2 for Invariant2).ifGenerates a lambda expression which behaves like invmap (for Invariant), or invmap2 (for Invariant2).juGenerates a lambda expression for invmap(2) for the given constructors. All constructors must be from the same type.kEGenerates a lambda expression for invmap(2) for a single constructor.lMGenerates a lambda expression for invmap(2) for an argument of a constructor.mqGenerates a lambda expression for invmap(2) for an argument of a constructor, after expanding all type synonyms.nGenerates a lambda expression for invmap(2) for a specific type. The generated expression depends on the number of type variables.oVExtracts a plain type constructor's information. | Boilerplate for top level splices.-The given Name must meet one of two criteria: JIt must be the name of a type constructor of a plain data type or newtype.NIt must be the name of a data family instance or newtype instance constructor.,Any other value will result in an exception.p]Deduces the instance context, instance head, and eta-reduced type variables for an instance.qRGiven a TyVarBndr, apply an Invariant(2) constraint to it, depending on its kind.r5Can a kind signature inhabit an Invariant constraint?:Invariant: Kind k1 -> k2 Invariant2: Kind k1 -> k2 -> k3sEither the given data type doesn't have enough type variables, or one of the type variables to be eta-reduced cannot realize kind *.tZThe data type has a DatatypeContext which mentions one of the eta-reduced type variables.ubThe data type has an existential constraint which mentions one of the eta-reduced type variables.vThe 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.w}One of the last type variables cannot be eta-reduced (see the canEtaReduce function for the criteria it would have to meet).ghijkxlmnopInvariant or Invariant2(The type constructor or data family nameThe datatype context=The type variables from the data type/data family declarationy; the types used to instantiate a data family instance, or z if it's a plain data typeqrstuvwghijkxlmnopqrstuvw1(C) 2012-2015 Nicolas Frisby, (C) 2015 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottPortableNone '1345>LWrap 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.A generic implementation of .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  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 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 StateVar package from the StateVar 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  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  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.Monoidfrom Data.Functor.Identityfrom Control.Exceptionfrom  Control.Arrowfrom Control.Applicativefrom Control.Applicativefrom Control.Applicativefrom Control.Applicative       !"#$%&'()*+,-.             !"#$%&'()*+,-./      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN.OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~56565655      !"#$%&'()*+,-./0123456789:;<=invar_LiuOTNuRQrb0hjzKHa2wnqData.Functor.InvariantData.Functor.Invariant.THPaths_invariant"Data.Functor.Invariant.TH.Internalbifun_7ffKqKh7Nct9QoErtCBlWEData.Bifunctor.WrappedunwrapBifunctor WrapBifunctorWrappedBifunctorderiveInvariantderiveInvariant2 makeInvmap makeInvmap2WrappedProfunctorWrapProfunctorunwrapProfunctor Invariant2invmap2WrappedContravariantWrapContravariantunwrapContravariantWrappedFunctor WrapFunctor unwrapFunctor Invariantinvmap invmapFunctorinvmapContravariantinvmap2Bifunctorinvmap2Profunctor genericInvmapcatchIOversionbindirlibdirdatadir 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 expandSynAppmkSubstsubstinvmapConstNameinvariantClassName invmapName invmap2Const getNameBasefst3thd3lookup2 wellKindedcanRealizeKindStarcreateKindChaindistinctKindVars tvbToTypeinvariantPackageKeymkInvariantName_tcmkInvariantName_vinvariantTypeNameinvariant2TypeName invmapValNameinvmap2ValNameinvmapConstValNameinvmap2ConstValName errorValName$fShowNameBase $fOrdNameBase $fEqNameBase$fEnumInvariantClassderiveInvariantClass invmapDecsmakeInvmapClassmakeInvmapForConsmakeInvmapForConmakeInvmapForArgmakeInvmapForArg'makeInvmapForTypewithTypebuildTypeInstanceapplyInvariantConstraintneedsConstraintderivingKindErrordatatypeContextErrorexistentialContextErroroutOfPlaceTyVarErroretaReductionErrormakeInvmapForArgsJustNothingprofu_9cpEHCJgNP4Cv1xp8BznOQData.Profunctor.Unsafe Profunctorcontr_LxARs66IWzOGQC8CMWQkcDData.Functor.Contravariant ContravariantFunctorData.Bifunctor Bifunctor$fInvariant:.: GHC.GenericsGeneric1$fInvariantRec1$fInvariantPar1 $fInvariantM1$fInvariant2K1 $fInvariantK1$fInvariant:*:$fInvariant:+: $fInvariantU1 $fInvariantV1$fInvariant2Constant$fInvariant2Tagged$fInvariant2Arg$fInvariant2TambaraSum$fInvariant2CotambaraSum$fInvariant2CopastroSum$fInvariant2Cotambara$fInvariant2Pastro$fInvariant2FreeTraversing$fInvariant2CofreeTraversing$fInvariant2FreeMapping$fInvariant2CofreeMapping$fInvariant2PastroSum$fInvariant2Tambara$fInvariant2Ran$fInvariant2Rift$fInvariant2Procompose$fInvariant2Codensity$fInvariant2Environment$fInvariant2Closure$fInvariant2Cayley$fInvariant2Forget$fInvariant2WrappedArrow$fInvariant2Costar$fInvariant2Star$fInvariant2Op$fInvariant2WrappedBifunctor$fInvariant2Tannen$fInvariant2Sum$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$fInvariantSettableStateVar$fInvariantStateVar$fInvariantArg$fInvariantOption$fInvariantLast$fInvariantFirst$fInvariantMax$fInvariantMin$fInvariantNonEmpty$fInvariantTambaraSum$fInvariantCotambaraSum$fInvariantCotambara$fInvariantTambara$fInvariantRan$fInvariantRift$fInvariantProcompose$fInvariantPrep$fInvariantCoprep$fInvariantCodensity$fInvariantClosure$fInvariantForget$fInvariantWrappedArrow$fInvariantCostar$fInvariantStar$fInvariantComposeFC$fInvariantComposeCF$fInvariantCompose0 $fInvariantOp$fInvariantEquivalence$fInvariantComparison$fInvariantPredicate$fInvariantTree$fInvariantViewR$fInvariantViewL$fInvariantSeq$fInvariantMap$fInvariantIntMap$fInvariantWrappedBifunctor$fInvariantTannen$fInvariantJoker$fInvariantJoin$fInvariantFlip$fInvariantFix$fInvariantClown$fInvariantBiff$fInvariantArray$fInvariantOptDescr$fInvariantArgOrder$fInvariantArgDescr$fInvariantProxy$fInvariantAlt$fInvariantLast0$fInvariantFirst0$fInvariantEndo$fInvariantDual$fInvariantIdentity$fInvariantHandler$fInvariantArrowMonad$fInvariantWrappedArrow0$fInvariantWrappedMonad$fInvariantZipList$fInvariantConst$$fProfunctorComonadWrappedProfunctor"$fProfunctorMonadWrappedProfunctor$$fProfunctorFunctorWrappedProfunctor$fMappingWrappedProfunctor$fTraversingWrappedProfunctor$fClosedWrappedProfunctor$fCochoiceWrappedProfunctor$fCostrongWrappedProfunctor$fChoiceWrappedProfunctor$fStrongWrappedProfunctor$fProfunctorWrappedProfunctor$fInvariantWrappedProfunctor$fInvariant2WrappedProfunctor$fInvariant2(,,,,)$fInvariant2(,,,)$fInvariant2(,,)$fInvariant2(,)$fInvariant2Either$fInvariant2(->)$fDecidableWrappedContravariant$fDivisibleWrappedContravariant#$fContravariantWrappedContravariant$fInvariantWrappedContravariant$fTraversableWrappedFunctor$fFoldableWrappedFunctor$fMonadPlusWrappedFunctor$fMonadWrappedFunctor$fAlternativeWrappedFunctor$fApplicativeWrappedFunctor$fFunctorWrappedFunctor$fInvariantWrappedFunctor$fInvariantErrorT$fInvariant(,,,,)$fInvariant(,,,)$fInvariant(,,)$fInvariant(,)$fInvariantEither$fInvariant(->)$fInvariantReadPrec$fInvariantReadP $fInvariantST$fInvariantST0 $fInvariantIO $fInvariant[]$fInvariantMaybe