úÎ!Y_  None  Derive the best* typeable instance for a given data type. €Derive the given TypeableN instance for a data type. Using N=0 generates a plain Typeable instance. Note that this function may  fail if it';s not possible to derive the requested TypeableN instance. 0Generate the typeOfN function of TypeableN, tell'Ming all instance context predicates and declarations we need. We also update R a state to have a counter for generating unique names for data types we declare. VReturns the expression to get the TypeRep of a given type variable with a given kind. cGet the appendix to Typeable for a given N. For N=0, this is the empty string, for all other Ns, it' s show N. wCalculate the maximum N for which a TypeableN instance is generatable for a given kind. How this works is explained in , the description at the top of this module. kSplit a kind into a list of kinds, where each list element is a kind of the parameter of the orginal kind. Q The list is ordered, a parameter which comes first comes first in the list too. ^Split the part in front of the arrow from a kind, and return the rest (if there is any rest). K Example: splitKind (* -> *) -> * -> * will return ((* -> *),Just * -> *).  This is used to implement . \Generate a data type with the given kind that has no constructor and return the name of it. B The state is used for generating unqiue names for the data type. TGet the kind of the given newtype or data type. If the given name does not refer to E a newtype or a data type, the function fails with an error message. WA helper function that makes sure the info is a TyConI, and throws an error otherwise.  dropEnd n l drops n items from the end of the list l;. This function is implemented the naive way, it might not  be the fastest. Chain two kinds with (->)    7  !"#$%&'()*+,-./0123456789      :      !"#$%&'()*+,-./0123456789:;<=>?typeable-th-0.1Data.Typeable.TH makeTypeable makeTypeableN typeableBody typeRepOf bestTypeableparams splitKind typeOfKind expectTyCondropEndtypeableSuffixkindOfchainKbaseData.Typeable.InternalTypeable Typeable1 Typeable2 Typeable3 Typeable4 Typeable5 Typeable6 Typeable7 Data.Typeablegcast2gcast1gcastmkTyCon typeRepKey TypeRepKey showsTypeReptypeOf6DefaulttypeOf5DefaulttypeOf4DefaulttypeOf3DefaulttypeOf2DefaulttypeOf1Default typeOfDefault tyConString typeRepArgs typeRepTyConmkTyCon3mkAppTy funResultTy splitTyConAppmkFunTy tyConName tyConModule tyConPackagetypeOf1typeOf2typeOf3typeOf4typeOf5typeOf6typeOf7cast mkTyConAppTypeRepTyContypeOf