N      !"#$%&'()*+,-./0123456789:;<=>?@ A B C D E F G H I J K L M Safe NOPQRSTUVWXYZOUVWXYZ NOPQRSTUVWXYZ/(C) 2008-2015 Edward Kmett, (C) 2015 Ryan Scott BSD-style (see the file LICENSE) Edward KmettTemplate HaskellNone[A NameBase paired with the name of its map function. For example, when deriving Bifunctor, its list of TyVarInfos might look like [(a, 'f), (b, 'g)].\*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).^BExpands all type synonyms in a type. Written by Dan Rosn in the  genifunctors package (licensed under BSD3)._#Extracts the name of a constructor.`KGenerate a list of fresh names with a common prefix, and numbered suffixes.aCRemove any occurrences of a forall-ed type variable from a list of  TyVarInfos.b#Extracts the name from a TyVarBndr.c#Extracts the kind from a TyVarBndr.dNReplace the Name of a TyVarBndr with one from a Type (if the Type has a Name).e)Applies a typeclass constraint to a type.fChecks 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 typesg&Extract the Name from a type variable.h*Extract the NameBase from a type variable.i6Peel off a kind signature from a Type (if it has one).jIs the given type a variable?kPIs the given type a type family constructor (and not a data family constructor)?lAAre all of the items in a list (which have an ordering) distinct?HThis uses Set (as opposed to nub) for better asymptotic time complexity.m=Does the given type mention any of the NameBases in the list?nDDoes an instance predicate mention any of the NameBases in the list?oxThe number of arrows that compose the spine of a kind signature (e.g., (* -> *) -> k -> * has two arrows on its spine).p)Construct a type via curried application.q7Fully applies a type constructor to its type variables.rHSplit an applied type into its individual components. For example, this: Either Int Char would split to this: [Either, Int, Char] sESplit a type signature by the arrows on its spine. For example, this: (Int -> String) -> Char -> () would split to this: [Int -> String, Char, ()] t)Like uncurryType, except on a kind level.uMOf form k1 -> k2 -> ... -> kn, where k is either a single kind variable or *.P[\vwx^yz{|}~_`abcdefghijklmnopqrstuM[\vwx^yz{|}~_`abcdefghijklmnopqrstuN[\vwx^yz{|}~_`abcdefghijklmnopqrstu/(C) 2008-2015 Edward Kmett, (C) 2015 Ryan Scott BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableNoneG&6A representation of which function is being generated.1A representation of which class is being derived. Generates a G instance declaration for the given data type or data family instance.1Generates a lambda expression which behaves like bimap (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 bifold (without requiring a  instance).1Generates a lambda expression which behaves like  bifoldMap (without requiring a  instance).1Generates a lambda expression which behaves like bifoldr (without requiring a  instance).1Generates a lambda expression which behaves like bifoldl (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  bitraverse (without requiring a  instance). 1Generates a lambda expression which behaves like  bisequenceA (without requiring a  instance). 1Generates a lambda expression which behaves like bimapM (without requiring a  instance). 1Generates a lambda expression which behaves like  bisequence (without requiring a  instance).PDerive a class instance declaration (depending on the BiClass argument's value).DGenerates a class instance declaration for a plain type constructor.NGenerates a class instance declaration for a data family instance constructor.Generates a declaration defining the primary function(s) corresponding to a particular class (bimap for Bifunctor, bifoldr and bifoldMap for Bifoldable, and bitraverse for Bitraversable).NFor why both bifoldr and bifoldMap are derived for Bifoldable, see Trac #7436.DGenerates a lambda expression which behaves like the BiFun 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.EGenerates a lambda expression for a single argument of a constructor.iGenerates a lambda expression for a single argument of a constructor, after expanding all type synonyms.2Generates a lambda expression for a specific type.0Extracts a plain type constructor's information.*Extracts a data family name's information.:Extracts a data family instance constructor's information.oDeduces the instance context, instance head, and eta-reduced type variables for a plain data type constructor.tDeduces the instance context, instance head, and eta-reduced type variables for a data family instance constructor.KGiven a TyVarBndr, apply a certain constraint to it, depending on its kind.Either the given data type doesn't have enough type variables, or one of the type variables to be eta-reduced cannot realize kind *.rOne of the last two type variables appeard in a contravariant position when deriving Bifoldable or Bitraversable.YA constructor has a function argument in a derived Bifoldable or Bitraversable 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).=   6 (C) 2011-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe*+ Minimal definition either  or  _ identifies foldable structures with two different varieties of elements. Common examples are  and '(,)': instance Bifoldable Either where bifoldMap f _ (Left a) = f a bifoldMap _ g (Right b) = g b instance Bifoldable (,) where bifoldr f g z (a, b) = f a (g b z)nWhen defining more than the minimal set of definitions, one should ensure that the following identities hold:   "a     f g "a  ( . f) ( . g)   f g z t "a  ( (Endo . f) (Endo . g) t) z 4Combines the elements of a structure using a monoid.   "a   UCombines the elements of a structure, given ways of mapping them to a common monoid.  f g "a  ( . f) ( . g) cCombines the elements of a structure in a right associative manner. Given a hypothetical function %toEitherList :: p a b -> [Either a b]T yielding a list of all elements of a structure in order, the following would hold:  f g z "a  ( f g) z . toEitherListaCombines the elments of a structure in a left associative manner. Given a hypothetical function %toEitherList :: p a b -> [Either a b]T yielding a list of all elements of a structure in order, the following would hold:  f g z "a  (acc -> # (f acc) (g acc)) z . toEitherListAs D, but strict in the result of the reduction functions at each step.2Right associative monadic bifold over a structure.As D, but strict in the result of the reductionf unctions at each step.1Left associative monadic bifold over a structure.As M, but ignores the results of the functions, merely performing the "actions".As 1, but with the structure as the primary argument.As N, but ignores the results of the functions, merely performing the "actions".As 1, but with the structure as the primary argument.As ), but ignores the results of the actions.As ), but ignores the results of the actions.6Collects the list of elements of a structure in order.AReduces a structure of lists to the concatenation of those lists.vGiven a means of mapping the elements of a structure to lists, computes the concatenation of all such lists in order.UDetermines whether any element of the structure satisfies the appropriate predicate.TDetermines whether all elements of the structure satisfy the appropriate predicate.     (C) 2011-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe*+ right-to-left state transformerleft-to-right state transformer  _ identifies bifunctorial data structures whose elements can be traversed in order, performing  or Q actions at each element, and collecting a result structure with the same shape.A definition of ! must satisfy the following laws:  naturality! (t . f) (t . g) "a t . ! f g) for every applicative transformation tidentity! Identity Identity "a Identity compositionCompose .  (! g1 g2) . ! f1 f2 "a  (Compose .  g1 . f1) (Compose .  g2 . f2) where an applicative transformation is a function t :: ( f,  g) => f a -> g apreserving the  operations: t ( x) =  x t (f  x) = t f  t x and the identity functor Identity and composition functors Compose are defined as newtype Identity a = Identity { runIdentity :: a } instance Functor Identity where fmap f (Identity x) = Identity (f x) instance Applicative Identity where pure = Identity Identity f <*> Identity x = Identity (f x) newtype Compose f g a = Compose (f (g a)) instance (Functor f, Functor g) => Functor (Compose f g) where fmap f (Compose x) = Compose (fmap (fmap f) x) instance (Applicative f, Applicative g) => Applicative (Compose f g) where pure = Compose . pure . pure Compose f <*> Compose x = Compose ((<*>) <$> f <*> x)Some simple examples are  and '(,)': instance Bitraversable Either where bitraverse f _ (Left x) = Left <$> f x bitraverse _ g (Right y) = Right <$> g y instance Bitraversable (,) where bitraverse f g (x, y) = (,) <$> f x <*> g y 3 relates to its superclasses in the following ways:  f g "a  runIdentity . ! (Identity . f) (Identity . g)  f g =  . ! ( . f) ( . g) These are available as ) and * respectively.!Evaluates the relevant functions at each element in the structure, running the action, and builds a new structure with the same shape, using the elements produced from sequencing the actions. ! f g "a " .  f g"ySequences all the actions in a structure, building a new structure with the same shape using the results of the actions. " "a !  #As !, but uses evidence that m is a  rather than an . # f g "a $ .  f g # f g "a  . ! ( . f) ( . g) $As ", but uses evidence that m is a  rather than an . $ "a #   $ "a  . " .    %% is !* with the structure as the first argument.&& is #* with the structure as the first argument.'DTraverses a structure from left to right, threading a state of type aH and using the given actions to compute new elements for the structure.(DTraverses a structure from right to left, threading a state of type aH and using the given actions to compute new elements for the structure.)A default definition of  in terms of the   operations.*A default definition of  in terms of the   operations.$ !"#$%&'()*      !"#$%&'()* !"$#%&'()* !"#$%&'()*     (C) 2011-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe. a . b "a  ( ) ( ) 0 a - b / a / b "a    0 a - b 2Lift binary functions3Lift ternary functions+,-./0123 +,-./0123 +,-./0123+,-./0123-./01(C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe+4 Compose two  s on the inside of a . 456!"#$%&'456456456!"#$%&'(C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe+7Make a   over the first argument of a . Mnemonic: Cl owns to the l1eft (parameter of the Bifunctor), joker s to the right. 789()*+,-.789789789()*+,-.(C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisional non-portableSafe*4:Greatest fixpoint of a  (a  ' over the first argument with zipping).:;</012:;<:;<:;</012(C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe+=Make a  flipping the arguments of a . =>?3456789=>?=>?=>?3456789 (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisional non-portableSafe*+4@Make a   over both arguments of a .@AB:;<=@AB@AB@AB:;<= (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe+CMake a   over the second argument of a . Mnemonic: Cl owns to the l1eft (parameter of the Bifunctor), joker s to the right. CDE>?@ABCDCDECDECDE>?@ABCD )(C) 2008-2015 Jesse Selover, Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe+F"Form the product of two bifunctorsFGEFGHFGFGFGEFGH (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe+H Compose a   on the outside of a . HIJIJKLMNOHIJHIJHIJIJKLMNO (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe+KMake a   over the second argument of a . KLMPQRSTUVKLMKLMKLMPQRSTUVW !"#$%&'()*+,-./0123456789:;<=>?@ABCDDEFFGHIJKKL M M N O O P Q R S S T U V WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~f 4       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b cdbifun_5YALODvEtA24oFsRFahHMXData.Bifunctor.THData.BifoldableData.BitraversableData.BiapplicativeData.Bifunctor.BiffData.Bifunctor.ClownData.Bifunctor.FixData.Bifunctor.FlipData.Bifunctor.JoinData.Bifunctor.JokerData.Bifunctor.ProductData.Bifunctor.TannenData.Bifunctor.WrappedPaths_bifunctorsData.Bifunctor.TH.Internal bitraversebimapM bisequenceA bisequencederiveBifunctor makeBimapderiveBifoldable makeBifold makeBifoldMap makeBifoldr makeBifoldlderiveBitraversablemakeBitraversemakeBisequenceA makeBimapMmakeBisequence Bifoldablebifold bifoldMapbifoldrbifoldlbifoldr'bifoldrMbifoldl'bifoldlM bitraverse_bifor_bimapM_biforM_ bisequenceA_ bisequence_biListbiconcat biconcatMapbianybiall BitraversablebiforbiforM bimapAccumL bimapAccumR bimapDefaultbifoldMapDefault Biapplicativebipure<<*>>*>><<*<<$>><<**>>biliftA2biliftA3BiffrunBiffClownrunClownFixInoutFliprunFlipJoinrunJoinJokerrunJokerProductPairTannen runTannenWrappedBifunctor WrapBifunctorunwrapBifunctorcatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName TyVarInfoNameBasetemplate-haskellLanguage.Haskell.TH.SyntaxnameBase expandSynconstructorName newNameListremoveForalledtvbNametvbKindreplaceTyVarName applyClass canEtaReduce varTToNamevarTToNameBaseunSigTisTyVar isTyFamily allDistinctmentionsNameBasepredMentionsNameBase numKindArrowsapplyTy applyTyCon unapplyTy uncurryTy uncurryKindcanRealizeKindStarChaingetNameSubst expandSynAppmkSubstsubst bimapConst bifoldrConstbifoldMapConstbitraverseConst getNameBasethd3 wellKindedcanRealizeKindStardistinctKindVars tvbToTypebifunctorsPackageKeymkBifunctorsName_tcmkBifunctorsName_vbifoldableTypeNamebitraversableTypeNamebifoldrValNamebifoldMapValNamebitraverseValNamebimapConstValNamebifoldrConstValNamebifoldMapConstValNamebitraverseConstValName dualDataName endoDataNamewrapMonadDataNamefunctorTypeNamefoldableTypeNametraversableTypeNameappEndoValNamecomposeValName idValName errorValName flipValName fmapValName foldrValNamefoldMapValNamegetDualValNametraverseValNameunwrapMonadValNamebifunctorTypeName bimapValName pureValName apValNamemappendValName memptyValName$fShowNameBase $fOrdNameBase $fEqNameBaseBiFunBiClass Bifunctor deriveBiClassderiveBiClassPlainTyderiveBiClassDataFamInst biFunDecs makeBiFunmakeBiFunForConsmakeBiFunForConmakeBiFunForArgsmakeBiFunForArgmakeBiFunForArg'makeBiFunForType withTyCon withDataFamwithDataFamInstConcxtAndTypePlainTycxtAndTypeDataFamInstConapplyConstraintderivingKindErrorcontravarianceErrornoFunctionsErrordatatypeContextErrorexistentialContextErroroutOfPlaceTyVarErroretaReductionErrorBimapBifoldr BifoldMap BitraversebiFunConstName biClassName biFunName biClassToFuns biFunToClassbiClassConstraint biFunArity allowFunTys allowExQuant biFunTrivbiFunApp biFunCombine bimapCombinebifoldrCombinebifoldMapCombinebitraverseCombinebase Data.EitherEitherGHC.Baseidmappendmempty Data.MonoidappEndo Data.Foldablefoldreitherfoldl$fBifoldableEither$fBifoldableTagged$fBifoldable(,,,,,,)$fBifoldable(,,,,,)$fBifoldable(,,,,)$fBifoldable(,,,)$fBifoldable(,,)$fBifoldableConst$fBifoldable(,)$fBifoldableArgStateRStateL ApplicativeMonadData.Traversabletraversefmappure<*>Data.BifunctorbimapControl.ApplicativegetConstConst unwrapMonad WrapMonadIdgetId runStateR runStateL$fApplicativeId $fFunctorId$fApplicativeStateR$fFunctorStateR$fApplicativeStateL$fFunctorStateL$fBitraversableTagged$fBitraversableConst$fBitraversableEither$fBitraversable(,,,,,,)$fBitraversable(,,,,,)$fBitraversable(,,,,)$fBitraversable(,,,)$fBitraversable(,,)$fBitraversable(,)$fBitraversableArgconst$fBiapplicativeConst$fBiapplicativeTagged$fBiapplicative(,,,,,,)$fBiapplicative(,,,,,)$fBiapplicative(,,,,)$fBiapplicative(,,,)$fBiapplicative(,,)$fBiapplicativeArg$fBiapplicative(,)secondfirstFunctor$fBitraversableBiff$fTraversableBiff$fBifoldableBiff$fFoldableBiff$fBiapplicativeBiff $fFunctorBiff$fBifunctorBiff$fTraversableClown$fBitraversableClown$fFoldableClown$fBifoldableClown$fBiapplicativeClown$fFunctorClown$fBifunctorClown$fTraversableFix $fFoldableFix$fApplicativeFix $fFunctorFix$fTraversableFlip$fBitraversableFlip$fFoldableFlip$fBifoldableFlip$fBiapplicativeFlip $fFunctorFlip$fBifunctorFlip$fTraversableJoin$fFoldableJoin$fApplicativeJoin $fFunctorJoin$fTraversableJoker$fBitraversableJoker$fFoldableJoker$fBifoldableJoker$fBiapplicativeJoker$fFunctorJoker$fBifunctorJoker$fBitraversableProduct$fBifoldableProduct$fBiapplicativeProduct$fBifunctorProduct$fBitraversableTannen$fTraversableTannen$fBifoldableTannen$fFoldableTannen$fBiapplicativeTannen$fFunctorTannen$fBifunctorTannen$fBitraversableWrappedBifunctor$fTraversableWrappedBifunctor$fBifoldableWrappedBifunctor$fFoldableWrappedBifunctor$fBiapplicativeWrappedBifunctor$fFunctorWrappedBifunctor$fBifunctorWrappedBifunctor