úÎBå<]L      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKNone&)*03457>KLNUUninhabited type.!LMNOPQRSTUVWXYZ[\]^_`abcdefghijk]^_`LMNOPQRSTUVWXYZ[\]^_`abcdefghijkNone0345>KLNUGType that represents meta information about fields of one constructor.>Record constructor, containing the list of the selector names.^Constructor with fields, but without selector names. The argument gives the number of fields.Constructor without fields. %Type for meta information about ADTs.unqualified name of the typelmnopq rstuvwxyzlmnopq rslmnopq  rstuvwxyzNone 345>LN An instance ( a) allows us to2convert values of an arbitrary algebraic datatype a* to and from a generic representation ( a) (see  and ).(extract meta information about the type a (see )./Once an algebraic datatype has an instance for  it automatically gets one for .m is a type level function that maps arbitrary ADTs to isomorphic generic representations. Here's an example:  data Foo = A Int Bool | B Stringwould be mapped to: 3Either (Int, (Bool, ())) (Either (String, ()) Void))These representations follow these rules::The choice between constructors is mapped to right-nested {s.&There's always a so-called end-marker !. It's an invalid choice (and U is uninhabited to make sure you don't accidentally create such a value). So e.g.  data Foo = A would be mapped to Either () Void2, and a type with no constructors is mapped to Void.@The fields of one constructor are mapped to right-nested tuples.6Again there's always an end-marker, this time of type ()%. A constructor with three fields a, b, c is mapped to (a, (b, (c, ()))) , one field a is mapped to (a, ())!, and no fields are mapped to () (just the end-marker).ÇThese rules (and the end-markers) are necessary to make sure generic functions know exactly which parts of the generic representation are field types and which parts belong to the generic skeleton.Convert a value of type a to its generic representation./Convert a value in a generic representation to a (inverse of ).'Extract meta information about the ADT.|}   |}None 013457N%This is the class %]. It's used to serialize every field of the used ADTs, so we need instances for all of them.3[This simple function extracts the names of all field selectors and returns them as a list: namesOfFields (Proxy :: Proxy A)["foo","bar","baz"]º(You're encouraged to look at the source code of the examples in this tutorial to understand how they work. If you're looking at a web page generated by haddock, you'll hopefully find Source links to the right.)41To tie everything together we provide a function 4< that converts a value of some ADT into an eot value using  and then uses (* to convert that eot value into a list of ~s.5 And here's 5 to tie it together. It uses $ to convert a list of ~s into an eot value and then ( to construct a value of the wanted ADT.66E ties everything together. It obtaines the meta information through  passing a  for a. And it creates a  for the eot-type: Proxy :: Proxy (Eot a)Then it calls   and just s the resulting snippets.7 !"#$%&'(-The number of the constructor being passed inThe eot representationA simple serialization format)*+,-./0123456789:;<=>?@ABCDEFGHIJK" !"#$%&'()*+,-./012345683-.1/002)*+,'(KJIH%&GFED4#$CBA@!"?>=<5 ;:9687$ !"#$%&'()*+,-.1/0023456789:;<=>?@ABCDEFGHIJK€        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPPQR STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…gener_CEHfmD2rkZhEBsHidDBNDC Generics.EotGenerics.Eot.TutorialGenerics.Eot.EotGenerics.Eot.Datatypebase GHC.GenericsGeneric Data.ProxyProxyVoidFields Selectors NoSelectorsNoFields ConstructorconstructorNamefieldsDatatype datatypeName constructorsHasEotEottoEotfromEotdatatypeCC1ToStringtoString NotSupportedPersonnameageEotCreateTableStatementeotCreateTableStatement Deserialize deserializeEotDeserializeeotDeserialize Serialize serialize EotSerialize eotSerializeBB1B2B3AA1foobarA2baz namesOfFieldsgenericSerializegenericDeserializecreateTableStatement $fSerializeC $fToStringInt$fEotCreateTableStatement[]()$fEotCreateTableStatement[](,)'$fEotCreateTableStatementDatatypeEither$fDeserializeBool$fDeserialize()$fDeserialize[]$fDeserializeInt$fEotDeserialize()$fEotDeserialize(,)$fEotDeserializeVoid$fEotDeserializeEither $fSerialize()$fSerializeBool $fSerialize[]$fSerializeInt$fEotSerialize()$fEotSerialize(,)$fEotSerializeVoid$fEotSerializeEitherConcat+++unConcat HasFieldsG toEotFields fromEotFields NormalizeGEithergLeftgRightgEitherHasConstructorsG ConstructorstoEotConstructorsfromEotConstructorsHasEotGEotGtoEotGfromEotG $fConcat()bs $fConcat(,)bs$fHasFieldsGU1$fHasFieldsGM1$fHasFieldsG:*:$fNormalizeVoidb$fNormalizeEitherc$fHasConstructorsGV1$fHasConstructorsGM1$fHasConstructorsG:+: $fHasEotGM1 GenericFields getFieldsCGenericConstructorsgetConstructorsGenericDatatype datatypeC getFieldsgetField$fGenericFieldsU1$fGenericFieldsM1$fGenericFields:*:$fGenericConstructorsV1$fGenericConstructorsM1$fGenericConstructors:+:$fGenericDatatypeM1 Data.EitherEitherImpliedByGeneric $fHasEotaghc-prim GHC.TypesInt Data.Foldableconcat