h&-6)P      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred/2k generic-functorarr is the list of arrows provided by the user. It is constant. When testing whether any arrow matches, arr'/ is the remaining list of arrows to be tested.generic-functorHeterogeneous lists of arrows are constructed as lists separated by () and terminated by ().ExampleGiven  f :: a -> a' and  g :: b -> b', (f  g  ())! is a list with the two elements f and g. +if f :: a -> a' g :: b -> b' then f  g  () :: (a -> a')  (b -> b')  () Those lists are used by  gmultimap and multimap. bimap_ :: (a -> a') -> (b -> b') -> (Maybe a, [Either b a]) -> (Maybe a', [Either b' a']) bimap_ f g = multimap (f  g  ()) generic-functorInternal implementation of .generic-functorFold m is like Kleisli (Const m), but it has a different  FunctorOf instance, with  instead of .generic-functorAuxiliary constraint for ! generic-functorInternal definition of !!generic-functorConstraint for %."generic-functorConstraint for &.#generic-functorCore of multimap.$generic-functorCore of multimap&generic-functor%This is kept internal because of the  wrapping.+  !"#$%&'()*+$%&'#"!   ()*11None/(F%Igeneric-functor*We use the same class to implement all of , , , instantiating m as , 'Const (EndoM mm)' and 'Aps n' respectively. Those three cases differ in their instances for .(the K stands for Kleisli, because the result is Kleisli m (f ()) (g ())Kgeneric-functornewtype for  DerivingVia of  and  instances.Note: deriving # for a generic type often requires . instances for types mentioned in the fields.Example 4{-# LANGUAGE DeriveGeneric, DerivingVia #-} import Data.Bifoldable ( ) import Data.Bifunctor ( ) import  GHC.Generics ( ) import Generic.Functor (M(..), K(..)) data Tree a b = Node a (Tree a b) (Tree a b) | Leaf b deriving  deriving (, ) via (M (Tree a)) deriving (, ) via (K1 Tree) data CofreeF f a b = a :< f b deriving  deriving (, ) via (K (CofreeF f)) Mgeneric-functornewtype for  DerivingVia of  and  instances.Note: the GHC extensions  DeriveFunctor, DeriveFoldable, and DeriveTraversable (which implies all three) already works out-of-the-box in most cases. There are exceptions, such as the following example.Example 4{-# LANGUAGE DeriveGeneric, DerivingVia #-} import  GHC.Generics ( ) import Generic.Functor (M4(..)) data Twice a = Twice (Either a a) deriving  deriving (, ) via (M Twice) Ogeneric-functorConstraint for k.Pgeneric-functorConstraint for j.Qgeneric-functorConstraint for i.Rgeneric-functorConstraint for h.Sgeneric-functorGeneric . Constraint for M (deriving-via ).Ugeneric-functorConstraint for p.Vgeneric-functorGeneric . Constraint for M (deriving-via ).Xgeneric-functorConstraint for o.Ygeneric-functorGeneric  Bitraversable.[generic-functorConstraint for q.\generic-functorGeneric .^generic-functorConstraint for q._generic-functorGeneric .`generic-functorConstraint for n.ageneric-functorInternal component of b.bgeneric-functorConstraint for m.cgeneric-functorInternal component of _.dgeneric-functorConstraint for l.egeneric-functorInternal component of f.This is an example of the "quantified constraints trick" to encode -forall a b. GMap1 a b (Rep (f a)) (Rep (f b))$ which doesn't actually work as-is.fgeneric-functorGeneric . Constraint for g.ggeneric-functorGeneric implementation of  . See also M for  DerivingVia , using g under the hood.Example '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics ( ) import Generic.Functor (g0) data Twice a = Twice (Either a a) deriving  instance  Twice where  = g Unlike h, g is safe to use in all contexts.hgeneric-functorGeneralized generic functor.h is a generalization of g (generic ), where the type parameter to be "mapped" does not have to be the last one.h is unsafe-: misuse will break your programs. Read the  #gsolomapusageUsage section below for details.Example '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics ( ) import Generic.Functor (h) data Result a r = Error a | Ok r -- Another name for Either deriving > mapError :: (a -> b) -> Result a r -> Result b r mapError = h8 mapOk :: (r -> s) -> Result a r -> Result a s mapOk = h< mapBoth :: (a -> b) -> Result a a -> Result b b mapBoth = h Usage  gsolomapusage(This also applies to i, j, and k.)h should only be used to define  polymorphic "fmap3-like functions". It works only in contexts where a and b are two distinct, non-unifiable type variables. This is usually the case when they are bound by universal quantification (forall a b. ...#), with no equality constraints on a and b.The one guarantee of h is that h  = . Under the above conditions, that law and the types should uniquely determine the implementation, which h seeks automatically.The unsafety is due to the use of incoherent instances as part of the definition of R). Functions are safe to specialize after R (and Q#) constraints have been discharged.&Note also that the type parameters of h must all be determined by the context. For instance, composing two h , as in h f . h g, is a type error because the type in the middle cannot be inferred.igeneric-functorGeneralized implicit functor.Use this when x and y) are applications of existing functors (, )."This is a different use case from  and h/, which make functors out of freshly declared data types.i is unsafe": misuse will break your programs.See the  #gsolomapusageUsage section of h for details.Example map1 :: (a -> b) -> Either e (Maybe [IO a]) -> Either e (Maybe [IO b]) map1 = i -- equivalent to: fmap . fmap . fmap . fmap map2 :: (a -> b) -> (e -> Either [a] r) -> (e -> Either [b] r) map2 = i4 -- equivalent to: \f -> fmap (bimap (fmap f) id) jgeneric-functorGeneric n-ary functor.A generalization of h2 to map over multiple parameters simultaneously. j( takes a list of functions separated by () and terminated by ().j is unsafe: misuse will break your programs. The type of every function in the list must be some (a -> b) where a and b are distinct type variables.See the  #gsolomapusageUsage section of h for details.Example '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics ( ) import Generic.Functor (j9) data Three a b c = One a | Two b | Three c deriving  mapThree :: (a -> a') -> (b -> b') -> (c -> c') -> Three a b c -> Three a' b' c' mapThree f g h = j (f  g  h  ()) kgeneric-functorImplicit n-ary functor.A generalization of i2 to map over multiple parameters simultaneously. k( takes a list of functions separated by () and terminated by ().k is unsafe: misuse will break your programs. The type of every function in the list must be some (a -> b) where a and b are distinct type variables.See the  #gsolomapusageUsage section of h for details.Example type F a b c = Either a (b, c) map3 :: (a -> a') -> (b -> b') -> (c -> c') -> F a b c -> F a' b' c' map3 f g h = k (f  g  h 6 ()) -- equivalent to: \f g h -> bimap f (bimap g h) lgeneric-functorGeneric implementation of  from  . See also K.mgeneric-functorGeneric implementation of  from  . See also K.ngeneric-functorGeneric implementation of  from  . See also K.ogeneric-functorGeneric implementation of  from .pgeneric-functorGeneric implementation of  from .qgeneric-functorGeneric implementation of  from .rgeneric-functorGeneric implementation of  bitraverse from  Bitraversable.sgeneric-functorExplicitly require a constraint, to force the instantiation of a quantified constraint.}generic-functorDanger! GFoldMap1 m arr f f4 MUST come from a quantified constraint (see use in o).:EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~:ghijklmnopqrsfedcba`_^]\[ZYXWVUTSRQPOMNKLtuvwxIJHyGz{|F}E~ Safe-Inferred(KLMNSUVXY[\^_`bdfglmnopqrMNKLgoqlmnprfVX\^_db`SUY[ Safe-Inferred)8 OPQRhijk hijkRQPO           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHHIIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~.generic-functor-1.0.0.0-4DOv5fK8vXzAKwobdb5F0Z!Generic.Functor.Internal.ImplicitGeneric.Functor.InternalGeneric.FunctorgfmapGeneric.Functor.MultimapS2SDefault IncoherentNilArr AnyBifunctor AnyFunctorAnyIdRule:+ Multimap_ multimap_ BifunctorOfcatbimap FunctorOfcatmapCatLikecatidFoldunFold MultimapOfCoercibleKleisli WrapKleisliMultitraverse_ Multitraverse Multifold_ MultimapI multimapI multitraverse multifold_ multimapOfdefaultIncoherentdefs2$fCoercibleKleislifaFUN$fCatLikeKleisli $fCatLikeFUN $fCatLikeFold$fFunctorOfKleislit$fFunctorOfFUNt$fFunctorOfFoldt$fBifunctorOfKleislit$fBifunctorOfFUNt$fBifunctorOfFoldt$fCoercibleKleislif:+:+$fCoercibleKleislifdRule$fCoercibleKleislifdNilArr$fMultimap_catSxx$fMultimap_catSab$fMultimap_catSxy$fMultimap_catSxy0$fMultimap_catSxy1$fMultimap_catSxy2$fMultimap_FUNSFUNFUN$fMultimap_catSff$fMultimap_catSff0$fMultimapOfcatarrxy$fMultitraversefarrxy$fMultifold_marrxy$fMultimapIarrxy GTraverse1 GFoldMap1EndoMGMap1 GMultimapK gmultimapKGenericBifunctorGenericFunctorMultimap GMultimapSolomapGSolomap GBifoldable GBifoldMapRep GBifoldMap GFoldable GFoldMapRepGFoldMapGBitraversableGBitraverseRep GBitraverse GTraversable GTraverseRep GTraverse GBifunctorGSecond GFirstRepGFirst GBimapRepGBimap GFunctorRepGFunctorgsolomapsolomap gmultimapmultimapgbimapgfirstgsecondgfoldMap gbifoldMap gtraverse gbitraversewithcoerce1coerce2coerce3 coerceFoldMapcoerceBifoldMapgmapRepunEndoM liftEndoM foldToConst gfoldMapRep gtraverseRep$fMultimaparrxy $fSolomapabxy$fGMultimapKmarrV1V1$fGMultimapKmarrU1U1$fGMultimapKmarr:*::*:$fGMultimapKmarr:+::+:$fGMultimapKmarrM1M1$fGMultimapKApsarrK1K1$fGMultimapKIdentityarrK1K1 $fGMap1arrfg$fGMultimaparrxy$fGSolomapabxy$fGFirstRepabcf $fGFirstf$fGBimapRepabcdf $fGBimapf$fGFunctorRepabf $fGSecondf$fBifunctorGenericBifunctor $fGBifunctorf$fFunctorGenericFunctor $fGFunctorf$fGMultimapKConstarrK1K1$fGMultimapKConstarrK1K10$fGFoldMap1marrfg$fGBifoldMapRepabcdmt$fGBifoldMapmt$fBifoldableGenericBifunctor$fGBifoldablet$fGFoldMapRepabmt $fGFoldMapmt$fFoldableGenericFunctor $fGFoldablet$fGTraverse1marrfg$fGBitraverseRepabcdft$fGBitraverseft$fGBitraversablet$fGTraversablet$fGTraverseRepabft $fGTraverseftbase Data.FoldableFoldableData.Traversable TraversableGHC.BasefmapfoldMaptraverseData.Functor.IdentityIdentity GHC.GenericsK1Data.Bifunctor BifunctorData.Bifoldable BifoldableFunctorGenericidbimapfirstsecond bifoldMap