Safe   (C) 2015-2016 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone&A mapping of type variable Names to their map function Names. For example, in a Functor declaration, a TyVarMap might look like (a ~> f), where a is the last type variable of the datatype, and f is the function which maps over a.EWhether a type is not of kind *, is of kind *, or is a kind variable.BExpands all type synonyms in a type. Written by Dan Rosn in the  genifunctors package (licensed under BSD3).8Does a Type have kind * or k (for some kind variable k)?Returns  the kind variable  of a # if it exists. Otherwise, returns  .!jConcat together all of the StarKindStatuses that are IsKindVar and extract the kind variables' Names out." Test if an # value is the $= constructor. Provided as standard with GHC 7.8 and above.%Pull the value out of an #/ where both alternatives have the same type. ?\x -> fromEither (Left x ) == x \x -> fromEither (Right x) == x&& takes a list of Bools and a list of some elements and filters out these elements for which the corresponding value in the list of Bools is False. This function does not check whether the lists have equal length.'' takes a list of Bools and two lists as input, and outputs a new list consisting of elements from the last two input lists. For each Bool in the list, if it is (;, then it takes an element from the former list. If it is )~, it takes an element from the latter list. The elements taken correspond to the index of the Bool in its list. For example: @filterByLists [True, False, True, False] "abcd" "wxyz" = "axcz" AThis function does not check whether the lists have equal length.** takes a list of Bools and a list of some elements and partitions the list according to the list of Bools. Elements corresponding to (+ go to the left; elements corresponding to ) go to the right. For example, ;partitionByList [True, False, True] [1,2,3] == ([1,3], [2])D This function does not check whether the lists have equal length.+ Apply an Either Exp Exp expression to an , expression, preserving the #-ness.-"Returns True if a Type has kind *..GGets all of the type/kind variable names mentioned somewhere in a Type./GGets all of the type/kind variable names mentioned somewhere in a Kind.0hasKindVarChain n kind Checks if kindj is of the form k_0 -> k_1 -> ... -> k_(n-1), where k0, k1, ..., and k_(n-1) can be * or kind variables.1EIf a Type is a SigT, returns its kind signature. Otherwise, return *.2KIf a VarT is missing an explicit kind signature, steal it from a TyVarBndr.3Monadic version of concatMap4#Extracts the name of a constructor.5KGenerate a list of fresh names with a common prefix, and numbered suffixes.6#Extracts the kind from a TyVarBndr.7Convert a TyVarBndr to a Type.8)Applies a typeclass constraint to a type.9Checks 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 types:iExtract Just the Name from a type variable. If the argument Type is not a type variable, return Nothing.;dExtract the Name from a type variable. If the argument Type is not a type variable, throw an error.<6Peel off a kind signature from a Type (if it has one).=Is the given type a variable?>PIs 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.@9Does the given type mention any of the Names in the list?A@Does an instance predicate mention any of the Names in the list?B)Construct a type via curried application.C7Fully applies a type constructor to its type variables.DHSplit an applied type into its individual components. For example, this: Either Int Char would split to this: [Either, Int, Char] EESplit a type signature by the arrows on its spine. For example, this: .forall a b. (a ~ b) => (a -> b) -> Char -> () would split to this: (a ~ b, [a -> b, Char, ()]) F)Like uncurryType, except on a kind level.TGHIJKLMNOPQRSTUV!"%&'*+-W./0123X456789:;<=>?@ABCDEFYZ[\]^_`abcdefghijklmnopqrstTGHIJKLMNOPQRSTUV!"%&'*+-W./0123X456789:;<=>?@ABCDEFYZ[\]^_`abcdefghijklmnopqrstQGHIJKLMNOPQRSTUV!"%&'*+-W./0123X456789:;<=>?@ABCDEFYZ[\]^_`abcdefghijklmnopqrst(C) 2015-2016 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone u6A representation of which function is being generated.v1A representation of which class is being derived. Generates a wG instance declaration for the given data type or data family instance.1Generates a lambda expression which behaves like x (without requiring a w instance).1Generates a lambda expression which behaves like y (without requiring a w instance).1Generates a lambda expression which behaves like fold (without requiring a w instance).1Generates a lambda expression which behaves like z (without requiring a w instance). Generates a {G instance declaration for the given data type or data family instance.1Generates a lambda expression which behaves like | (without requiring a { instance). Generates a }G instance declaration for the given data type or data family instance.1Generates a lambda expression which behaves like ~ (without requiring a } instance). 1Generates a lambda expression which behaves like  (without requiring a } instance). 1Generates a lambda expression which behaves like  (without requiring a } instance). 1Generates a lambda expression which behaves like  (without requiring a } instance).UDerive a class instance declaration (depending on the FunctorClass argument's value).Generates a declaration defining the primary function(s) corresponding to a particular class (fmap for Functor, foldr and foldMap for Foldable, and traverse for Traversable).HFor why both foldr and foldMap are derived for Foldable, see Trac #7436.IGenerates a lambda expression which behaves like the FunctorFun argument.gGenerates a lambda expression for the given constructors. All constructors must be from the same type.7Generates a lambda expression for a single constructor.CGenerates a lambda expression for a single constructor's arguments.^Generates a lambda expression for a single argument of a constructor. The returned value is $A if its type mentions the last type parameter. Otherwise, it is .JGenerates a lambda expression for a specific type. The returned value is $A if its type mentions the last type parameter. Otherwise, it is ."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.6Deduces the instance context and head for an instance.Attempt to derive a constraint on a Type. If successful, return Just the constraint and any kind variable names constrained to *. Otherwise, return Nothing and the empty list.dSee Note [Type inference in derived instances] for the heuristics used to come up with constraints.Either the given data type doesn't have enough type variables, or one of the type variables to be eta-reduced cannot realize kind *.SThe last type variable appeared in a contravariant position when deriving Functor.UA constructor has a function argument in a derived Foldable or Traversable instance.ZThe data type has a DatatypeContext which mentions one of the eta-reduced type variables.bThe data type has an existential constraint which mentions one of the eta-reduced type variables.The 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).8uv !Functor, Foldable, or Traversable(The type constructor or data family nameThe datatype context=The type variables from the data type/data family declaration; the types used to instantiate a data family instance, or   if it's a plain data type!Functor, Foldable, or Traversable(The type constructor or data family nameThe datatype context*The types to instantiate the instance with+True if it's a data family, False otherwise  1uv (C) 2015-2016 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone  (C) 2015-2016 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone(C) 2015-2016 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone(C) 2015-2016 Ryan Scott BSD-style (see the file LICENSE) Ryan ScottTemplate HaskellNone        !"#$%&'()*+&',-.&/0&/12345675689:)*;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&&&&&'&'&&&&&&/deriv_DGX9YUJW0GDLEbSvC4Ev6QData.Foldable.DerivingData.Functor.DerivingData.Traversable.DerivingPaths_deriving_compatData.Deriving.InternalData.Functor.Deriving.Internal Data.DerivingderiveFoldable makeFoldMap makeFoldrmakeFold makeFoldl deriveFunctormakeFmapderiveTraversable makeTraverse makeSequenceAmakeMapM makeSequencecatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameTyVarMapStarKindStatus expandSyncanRealizeKindStarstarKindStatusToNamebaseGHC.BaseJusttemplate-haskellLanguage.Haskell.TH.SyntaxNameNothingcatKindVarNamesisRight Data.EitherEitherRight fromEither filterByList filterByListsghc-prim GHC.TypesTrueFalsepartitionByList appEitherEExp hasKindStartyVarNamesOfTypetyVarNamesOfKindhasKindVarChaintyKindstealKindForType concatMapMconstructorName newNameListtvbKind tvbToType applyClass canEtaReducevarTToName_maybe varTToNameunSigTisTyVar isTyFamily allDistinct mentionsNamepredMentionsNameapplyTy applyTyCon unapplyTy uncurryTy uncurryKind NotKindStarKindStar IsKindVar KindSubst TypeSubst expandSynKind expandSynAppmkSubst substType substKindsubstNameWithKindsubstNamesWithKindStar fmapConst foldrConst foldMapConst traverseConst isStarOrVarthd3derivingCompatPackageKeymkDerivingCompatName_vfmapConstValNamefoldrConstValNamefoldMapConstValNametraverseConstValName dualDataName endoDataNamewrapMonadDataNamefunctorTypeNamefoldableTypeNametraversableTypeNameappEndoValNamecomposeValName errorValName flipValName fmapValName foldrValNamefoldMapValNamegetDualValName idValNametraverseValNameunwrapMonadValName starKindName pureValName apValNamemappendValName memptyValName FunctorFun FunctorClass Data.FoldableFoldablefoldMapfoldrfoldlFunctorfmapData.Traversable Traversabletraverse sequenceAmapMsequencederiveFunctorClassfunctorFunDecsmakeFunctorFunmakeFunctorFunForConsmakeFunctorFunForConmakeFunctorFunForArgsmakeFunctorFunForArgLeftmakeFunctorFunForTypewithTypebuildTypeInstancederiveConstraintderivingKindErrorcontravarianceErrornoFunctionsErrordatatypeContextErrorexistentialContextErroroutOfPlaceTyVarErroretaReductionErrorFmapFoldrFoldMapTraversebuildTypeInstanceFromTys reifyConTysfunctorFunConstNamefunctorClassNamefunctorFunNamefunctorClassToFunsfunctorFunToClass allowFunTys allowExQuantfunctorFunTriv functorFunAppfunctorFunCombine fmapCombine foldrCombinefoldMapCombinetraverseCombine$fShowFunctorFun