úÎ!h dA      !"#$%&'()*+,-./0123456789:;<=>?@None,=>?@ASUVXfkqaâgeneric-functorarrf 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-functorEHeterogeneous 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  and . gbimap_ :: (a -> a') -> (b -> b') -> (Maybe a, [Either b a]) -> (Maybe a', [Either b' a']) bimap_ f g =  (f  g  ()) generic-functorInternal implementation of . generic-functornewtype for  DerivingVia of A instances.Note: deriving A# for a generic type often requires B. instances for types mentioned in the fields.Example 4{-# LANGUAGE DeriveGeneric, DerivingVia #-} import  GHC.Generics (C ) import Generic.Functor ( (..),  H(..)) data Tree a b = Node a (Tree a b) (Tree a b) | Leaf b deriving C deriving B via (  (Tree a)) deriving A via ( 1 Tree) data CofreeF f a b = a :< f b deriving C deriving A via (  (CofreeF f)) generic-functornewtype for  DerivingVia of B instances.Note: the GHC extension  DeriveFunctorb 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 (C ) import Generic.Functor ( 4(..)) data Twice a = Twice (Either a a) deriving C deriving B via (  Twice) generic-functorConstraint for .generic-functorConstraint for .generic-functorConstraint for .generic-functorConstraint for .generic-functorConstraint for .generic-functorInternal component of .generic-functorConstraint for .generic-functorInternal component of .generic-functorConstraint for .generic-functorInternal component of .DThis 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.generic-functorConstraint for .generic-functorGeneric implementation of D . See also   for  DerivingVia , using  under the hood.Example '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics (C ) import Generic.Functor (0) data Twice a = Twice (Either a a) deriving C instance B Twice where D =  Unlike ,  is safe to use in all contexts.generic-functorGeneralized generic functor. is a generalization of  (generic DM), where the type parameter to be "mapped" does not have to be the last one. is unsafe-: misuse will break your programs. Read the  #gsolomapusageUsage section below for details.Example '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics (C ) import Generic.Functor (K) data Result a r = Error a | Ok r -- Another name for Either deriving C> mapError :: (a -> b) -> Result a r -> Result b r mapError = 8 mapOk :: (r -> s) -> Result a r -> Result a s mapOk = < mapBoth :: (a -> b) -> Result a a -> Result b b mapBoth =  Usage  gsolomapusage(This also applies to , , and .) 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  is that  E = Ek. Under the above conditions, that law and the types should uniquely determine the implementation, which  seeks automatically.UThe unsafety is due to the use of incoherent instances as part of the definition of ). Functions are safe to specialize after  (and #) constraints have been discharged.generic-functorGeneralized implicit functor.Use this when x and y) are applications of existing functors (B, A)."This is a different use case from  and /, which make functors out of freshly declared data types. is unsafe": misuse will break your programs.See the  #gsolomapusageUsage section of  for details.Example Nmap1 :: (a -> b) -> Either e (Maybe [IO a]) -> Either e (Maybe [IO b]) map1 = v -- equivalent to: fmap . fmap . fmap . fmap map2 :: (a -> b) -> (e -> Either [a] r) -> (e -> Either [b] r) map2 = 4 -- equivalent to: \f -> fmap (bimap (fmap f) id) generic-functorGeneric n-ary functor.A generalization of 2 to map over multiple parameters simultaneously. ( takes a list of functions separated by () and terminated by (). is unsafeX: 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  for details.Example '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics (C ) import Generic.Functor (9) data Three a b c = One a | Two b | Three c deriving Cd mapThree :: (a -> a') -> (b -> b') -> (c -> c') -> Three a b c -> Three a' b' c' mapThree f g h =  (f  g  h  ()) generic-functorImplicit n-ary functor.A generalization of 2 to map over multiple parameters simultaneously. ( takes a list of functions separated by () and terminated by (). is unsafeX: 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  for details.Example rtype 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 =  (f  g  h 6 ()) -- equivalent to: \f g h -> bimap f (bimap g h) generic-functorGeneric implementation of F . See also  .generic-functorGeneric implementation of G . See also  .generic-functorGeneric implementation of H . See also  . generic-functorWExplicitly require a constraint, to force the instantiation of a quantified constraint.%  !"#$%  !"#$11Nonecf   I        !"#$%&'()*+,-./0123456789:;<=>?@AB@CD@EF@CG@CH@AI@AJ@AKL.generic-functor-0.1.0.0-23lcFJtUk5IKX1k248fgbCGeneric.Functor.InternalGeneric.FunctorS2S:+ Multimap_ multimap_GMap1gmap1DeriveBifunctor DeriveFunctorMultimap GMultimapSolomapGSolomapGSecond GFirstRepGFirst GBifunctorRep GBifunctor GFunctorRepGFunctorgfmapgsolomapsolomap gmultimapmultimapgbimapgfirstgsecondwithcoerce1coerce2coerce3s2$fGMap1arrV1V1$fGMap1arrU1U1$fGMap1arr:*::*:$fGMap1arr:+::+:$fGMap1arrM1M1$fGMultimaparrxy$fGSolomapabxy$fGFirstRepabcf $fGFirstf$fGBifunctorRepabcdf $fGBifunctorf$fGFunctorRepabf$fBifunctorDeriveBifunctor $fGSecondf$fFunctorDeriveFunctor $fGFunctorf$fMultimap_Sff$fMultimap_Sff0$fMultimap_Sxx$fMultimap_Sxy$fMultimap_Sab$fMultimap_Sff1$fMultimap_Sff2$fMultimap_S->->$fMultimap_Sff3$fGMap1arrK1K1$fMultimaparrxy $fSolomapabxybaseData.Bifunctor BifunctorGHC.BaseFunctor GHC.GenericsGenericfmapidbimapfirstsecond