!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl m n o p q r s t u v w x y z { | } ~  #(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe!">KL#(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe>sDatatype to represent the fixity of a constructor. An infix declaration directly corresponds to an application of  . [Class for datatypes that represent data constructors. For non-symbolic constructors, only  L has to be defined. The weird argument is supposed to be instantiated with C$ from base, hence the complex kind.      #(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe !"7>IKLN .Semi-decidable equality for types of a family.BClass that contains the shallow conversion functions for a family."Class for the members of a family.7Type family describing the pattern functor of a family.Unlifted version of ).Unlifted version of ,.Represents constructors.5Represents composition with functors of kind * -> *. GIs used to indicate the type that a particular constructor injects to.";Represents products (sequences of fields of a constructor).$/Represents sums (choices between constructors).''Represents constructors without fields.);Represents constant types that do not belong to the family.,WRepresents recursive positions. The first argument indicates which type to recurse on./Destructor for '(:>:)'.0Destructor for .1+For backwards-compatibility: a synonym for .(  !"#$%&'()*+,-./012  !"#$%&'()*+,-./01%,-.)*+'($%&"# !/01   !"#$%&'()*+,-./01 "#$#(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe !"357IKLN4 The function 4 takes a functor fP. All the recursive instances in that functor are wrapped by an application of r. The argument to 4# takes a function that transformes r occurrences into r' occurrences, for every ix". In order to associate the index ix with the correct family phi, the argument to hmap5 is additionally parameterized by a witness of type phi ix. 5Monadic version of 4. 23456789:;<=2345 23=<;:987645 23456789:;<=#(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe !"4>HIKLN>?@ABCDEFGHIJKLMNOPQRST>?@ABCDEFGHIJKLMNOPQRSTKJIHLMGFEDNOCBA@PQ?>RST>?@ABCDEFGHIJKLMNOPQRST> R#(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe4INUNormal version.VMonadic version of U.WApplicative version of U.UVWUVWUVWUVW#(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe !"3457IKLNcCFor constant types, we make use of the standard equality function.XYZ[\]^_`abcdefXYZ[\Z[XYfedcba`_^]\ XYZ[\]^_`abcdef#(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe4>Lghijkghijkghijkghijk #(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableNone!">l;Given the name of the family index GADT, derive everything.mIGiven a list of datatype names, derive datatypes and instances of class  . Not needed if l is used.nCompatibility. Use l instead.Given the name of the index GADT, the names of the types in the family, and the name (as string) for the pattern functor to derive, generate the Ix and  instances.  IMPORTANTg: It is assumed that the constructors of the GADT have the same names as the datatypes in the family.oCompatibility. Use l instead.pDerive only the  instance. Not needed if l is used.qDerive only the  instances. Not needed if l is used.rDerive only the  instance. Not needed if l is used.sDerive only the   instance. Not needed if l is used.Process the reified info of the index GADT, and extract its constructor names, which are also the names of the datatypes that are part of the family.MProcess the reified info of the index GADT, and extract its type parameters.ZTurn a record-constructor into a normal constructor by just removing all the field names.Takes the name of a datatype (element of the family). By reifying the datatype, we obtain its constructors. For each constructor, we then generate a constructor-specific datatype, and an instance of the   class.@Given a constructor, create an empty datatype of the same name./Given a constructor, create an instance of the  9 class for the datatype associated with the constructor.Takes all the names of datatypes belonging to the family, and a particular of these names. Produces the right hand side of the ' type family instance for this family.Takes all the names of datatypes belonging to the family, and a particular name of a constructor of one of the datatypes. Creates the product structure for this constructor.Takes all the names of datatypes belonging to the family, and a particular type (that occurs as a field in one of these datatypes). Produces the structure for this type. We have to distinguish between recursive calls, compositions, and constants.TODO: We currently treat all applications as compositions. However, we can argue that applications should be treated as compositions only if the entire construct cannot be treated as a constant.$lmnopqrslmnopqrslmnopqrs$lmnopqrs #(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe4>IKLN tuvwxyz{|}~tuv tu~}|{zyxwv tuvwxyz{|}~ #(c) 2009--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe !"4>HIKLN  #(c) 2008--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe !"3457IKLNThe list in the result type allows us to get at the fields of a constructor individually, which in turn allows us to insert additional stuff in between if record notation is used.?For constant types, we make use of the standard show function.  #(c) 2009--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe!"345>HIKLN ?The class fold explains how to convert a convenient algebra [ back into a function from functor to result, as required by the standard fold function.The algebras passed to the fold have to work for all index types in the family. The additional witness argument is required only to make GHC's typechecker happy.;The type family we use to describe the convenient algebras.Fold with convenient algebras.For constructing algebras that are made of nested pairs rather than n-ary tuples, it is helpful to use this pairing combinator.Constructors are ignored.,A tag changes the index of the final result.eFor a product where the left hand side is a constant, we take the value as an additional argument.1For a sum, the algebra is a pair of two algebras. eFor an identity, we turn the recursive result into a final result. Note that the index can change. 'For a unit, no arguments are available. 7For a constant, we take the constant value to a result.          #(c) 2009--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe!"345>HIKLN ?The class fold explains how to convert a convenient algebra [ back into a function from functor to result, as required by the standard fold function.The algebras passed to the fold have to work for all index types in the family. The additional witness argument is required only to make GHC's typechecker happy.;The type family we use to describe the convenient algebras.Fold with convenient algebras.For constructing algebras that are made of nested pairs rather than n-ary tuples, it is helpful to use this pairing combinator.Constructors are ignored.Tags are ignored.qFor a product where the left hand side is an identity, we take the recursive result as an additional argument.eFor a product where the left hand side is a constant, we take the value as an additional argument.1For a sum, the algebra is a pair of two algebras.eFor an identity, we turn the recursive result into a final result. Note that the index can change.'For a unit, no arguments are available.7For a constant, we take the constant value to a result.#(c) 2009--2010 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafe !"3457>IKLN(c) 2008 Universiteit UtrechtBSD3generics@haskell.org experimental non-portableSafec  !"#$%&'()*+,-./012345>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\ghijk !"#$%&&'(()**+,-./00123445567789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu v w x y z { | } ~  H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^    T   V \ TV\           ADQ8dybuaGMHKSdd17q70QGenerics.MultiRec.TEqGenerics.MultiRec.ConstructorGenerics.MultiRec.BaseGenerics.MultiRec.HFunctorGenerics.MultiRec.FoldGenerics.MultiRec.ComposGenerics.MultiRec.EqGenerics.MultiRec.HFixGenerics.MultiRec.THGenerics.MultiRec.ConNamesGenerics.MultiRec.FoldKGenerics.MultiRec.ShowGenerics.MultiRec.FoldAlgGenerics.MultiRec.FoldAlgKGenerics.MultiRec.ReadGenerics.MultiRec:=:Reflcast AssociativityLeftAssociativeRightAssociativeNotAssociativeFixityPrefixInfix ConstructorconName conFixityEqSeqSFamfromtoElproofPFK0unK0I0unI0C:.:DunD:>:Tag:*::+:LRUKunKIunIunTagunCindexHFunctorhmapAhmaphmapM$fHFunctorphiC$fHFunctorphi:.:$fHFunctorphi:>:$fHFunctorphi:*:$fHFunctorphi:+:$fHFunctorphiU$fHFunctorphiK$fHFunctorphiI:->AlgPart ParaAlgebraF ParaAlgebraF' ParaAlgebra ParaAlgebra' CoAlgebraF CoAlgebraF' CoAlgebra CoAlgebra'AlgebraF AlgebraF'AlgebraAlgebra'foldfoldMunfoldunfoldMparaparaM&tagconcomposcomposMcomposAEq1eq1HEqheqeq $fHEqphiC $fHEqphi:>: $fHEqphi:.: $fHEqphi:*: $fHEqphi:+: $fHEqphiU $fHEqphiK $fHEqphiI $fEq1Maybe$fEq1[]HFixHInhouthfromhto deriveAllderiveConstructors deriveFamily deriveSystemderivePFderiveEl deriveFam deriveEqSConNames hconNamesconNames $fConNames:>: $fConNamesI $fConNames:.: $fConNames:*: $fConNamesU $fConNamesK $fConNames:+: $fConNamesCShow1show1HShow hShowsPrecAlg showsPrecshowspacescommas intersperse $fShow1[] $fShow1Maybe $fHShowphiC $fHShowphi:.: $fHShowphi:>: $fHShowphi:*: $fHShowphi:+: $fHShowphiU $fHShowphiK $fHShowphiIFoldalgCompAlg$fFoldC $fFold:>: $fFold:*: $fFold:*:0 $fFold:+: $fFold:.:$fFoldI$fFoldU$fFoldKRead1read1 HReadPrechreader CountAtoms countatomsreadConsreadPrefixCons readInfixConsreadNoArgsConsappPrecreadPrec readsPrecread$fHReadPrecphiC$fHReadPrecphiC0$fHReadPrecphiC1$fHReadPrecphiC2$fHReadPrecphiC3 $fRead1Maybe $fRead1[]$fHReadPrecphi:.:$fHReadPrecphi:>:$fHReadPrecphi:*:$fHReadPrecphi:+:$fHReadPrecphiI$fHReadPrecphiK$fHReadPrecphiU$fCountAtoms:*: $fCountAtomsI $fCountAtomsK $fFunctorK0$fApplicativeI0 $fFunctorI0extractConstructorNamesextractParametersstripRecordNamesconstrInstancemkData mkInstancepfTypepfConpfFieldderivePFInstanceextractFromBndrfixityassocunApp elInstancemkFrommkTomkProoffromContoCon fromField fromFieldFuntoField toFieldFunfieldlrPlrE remakeNameTFCo:R:AlgCrixTFCo:R:Alg:>:rixTFCo:R:Alg:*:rixTFCo:R:Alg:+:rixTFCo:R:AlgIrixTFCo:R:AlgUrixTFCo:R:AlgKrixTFCo:R:Comp:.:rixTFCo:R:CompKrixTFCo:R:CompIrixTFCo:R:Alg:.:rix TFCo:R:AlgCrTFCo:R:Alg:>:rTFCo:R:Alg:*:rTFCo:R:Alg:*:r0TFCo:R:Alg:+:r TFCo:R:AlgIr TFCo:R:AlgUr TFCo:R:AlgKr