!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe ,DQRT Envelope to get Nats with * kind*Convert a Nat to the corresponding IntegeranatVal (undefined::A5)5 *  Safe+,DQR A data typeType application 8Abstract a concrete type to a type applied to variables.RMore precisely: to a meta-representation where type application is represented by , data types are marked by " and variables are represented by  types.vBUG: Silently fails for types with more than 9 parameters (should be defined recursively, if you know how let me know) Examples: > undefined :: Ana (Maybe Char)@undefined :: Ana (Maybe Char) :: App (Typ (Maybe A0)) (Typ Char) $> undefined :: Ana (Either Int Char)[undefined :: Ana (Either Int Char) :: App (App (Typ (Either A0 A1)) (Typ Int)) (Typ Char)  > undefined :: Ana ([(Bool,())])aundefined :: Ana ([(Bool,())]) :: App (Typ [A0]) (App (App (Typ (A0, A1)) (Typ Bool)) (Typ ())) -   Safe9:;<= !A list of error messages"NReturn the groups of mutually dependent entities, with more than one componentOproperMutualGroups Just (M.fromList [("a",["b","c"]),("b",["a","c"]),("c",[])])Right [["b","a"]]#0Return the groups of mutually dependent entitiesImutualGroups Just (M.fromList [("a",["b","c"]),("b",["a","c"]),("c",[])])Right [["c"],["b","a"]]$eReturn the transitive closure of an element in a graph of dependencies specified as an adjacency listftransitiveClosure Just (M.fromList [("a",["b","c"]),("b",["b","d","d","c"]),("c",[]),("d",["a"])]) "b"Right ["c","a","d","b"]ftransitiveClosure Just (M.fromList [("a",["b","c"]),("b",["b","d","d","c"]),("c",[]),("d",["a"])]) "c" Right ["c"](]errorsToConvertResult (const (Left ["Bad format","Invalid value"])) ".." :: ConvertResult IntLeft (ConvertError {convSourceValue = "\"..\"", convSourceType = "[Char]", convDestType = "Int", convErrorMessage = "Bad format, Invalid value"}))'convertOrError 'a' :: Either Error WordRight 972convertOrError (1E50::Double) :: Either Error WordLeft "Convertible: error converting source data 1.0e50 of type Double to type Word: Input value outside of bounds: (0,18446744073709551615)",$Prefix errors with a contextual note-/Prefix a list of strings with a contextual note$inContext "0/0" ["Zero denominator"]["In 0/0: Zero denominator"].FIntercalate a dot between the non empty elements of a list of strings. dotted []""dotted ["","bc","de"]"bc.de"dotted ["bc","","de"]"bc.de"!"#$%&'()*+,-./ !"#$%&'()*+,-."#$!%&,-'(*+) .!"#$%&'()*+,-./Safe 234579;<=/1 Simple name3A fully qualified Haskell name8A reference to a type9 Type variable:Type reference;>Another representation of a type, sometime easier to work with=A type>Type constructor (Bool,Maybe,..)?Type applicationA+Constructors are assembled in a binary treeCConstructor tree.GConstructors are disposed in an optimally balanced, right heavier tree:For example, the data type: (data N = One | Two | Three | Four | Five9Would have its contructors ordered in the following tree: K | | | One Two Three | Four Five7To get a list of constructor in declaration order, use VD-The constructor name, unique in the data typeE{Constructor fields, they can be either unnamed (Left case) or named (Right case) If they are named, they must all be namedF(Simple algebraic data type (not a GADT)::declName: type used to represent the name of the data type:consName: type used to represent the name of a constructorwref: type used to represent a reference to a type or a type variable inside the data type definition (for example P)H'The name of the data type (for example Bool for  data Bool)I?The number of type parameters/variable (up to a maximum of 255)JThe constructors, if presentKeA map of all the ADTs that are directly or indirectly referred by a type, indexed by a type referenceLKThe complete model of a type, a reference to the type plus its environment:8adtName: type used to represent the name of a data type:consName: type used to represent the name of a constructorwinRef: type used to represent a reference to a type or a type variable inside the data type definition (for example P)UexRef: type used to represent a reference to a type in the type name (for example 3)N.The type application corresponding to the typeO,The environment in which the type is definedPReference to an Haskell TypeQ Haskell TypeR Haskell ADTSHaskell TypeModelTHaskell EnvironmentU!The ADTs defined in the TypeModelV3Return the list of constructors in definition orderWDConvert a (possibly empty) list of constructors in (maybe) a ConTreeXReturn just the field typesY=Return just the field names (or an empty list if unspecified)Z?Return the binary encoding and parameter types of a constructorThe binary encoding is the sequence of Left (False) and Right (True) turns needed to reach the constructor from the constructor tree root[JMap on the constructor types (used for example when eliminating variables)\!Map over a constructor tree names]"Fold over a constructor tree names^+Extract list of types in a constructor tree_)Fold over the types in a constructor tree`4Map over the names of an ADT and of its constructorsaConvert from Type to TypeNbConvert from TypeN to Typec!Returns the list of nested TypeNs4nestedTypeNs $ TypeN "F" [TypeN "G" [],TypeN "Z" []]A[TypeN "F" [TypeN "G" [],TypeN "Z" []],TypeN "G" [],TypeN "Z" []]LnestedTypeNs $ TypeN "F" [TypeN "G" [TypeN "H" [TypeN "L" []]],TypeN "Z" []][TypeN "F" [TypeN "G" [TypeN "H" [TypeN "L" []]],TypeN "Z" []],TypeN "G" [TypeN "H" [TypeN "L" []]],TypeN "H" [TypeN "L" []],TypeN "L" [],TypeN "Z" []]doRemove variable references (for example if we know that a type is fully saturated and cannot contain variables)eExtract referencef2Return the qualified name, minus the package name.GqualName (QualName {pkgName = "ab", mdlName = "cd.ef", locName = "gh"}) "cd.ef.gh"Convert a String to a 3 , if possibleasQualName "ab.cd.ef.gh"FSuccess (QualName {pkgName = "ab", mdlName = "cd.ef", locName = "gh"})asQualName "ab.cd.ef"CSuccess (QualName {pkgName = "ab", mdlName = "cd", locName = "ef"})asQualName "ab.cd"ASuccess (QualName {pkgName = "", mdlName = "ab", locName = "cd"})asQualName "ab"?Success (QualName {pkgName = "", mdlName = "", locName = "ab"}) asQualName "" Failure ["Empty qualified name"]asQualName "." Failure ["Empty qualified name"][The conversion assumes that the input String is a well-formed Haskell fully qualified name.6It will produce funny results if this is not the case:asQualName "**.&&.!!"CSuccess (QualName {pkgName = "**", mdlName = "&&", locName = "!!"})gESolve all references in a data structure, using the given environmenthESolve a key in an environment, returns an error if the key is missing>123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY123456789:;<=>?@ABCEDFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh:LMNOKUFGHIJABCDE@=>?;<c89:1234567f`abWVZ\][^_XYTSRQPhgde)123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmSafe9:;LcCompact representation: a value enveloped in CompactPretty will have only its first lines displayed.Convert a variable number (0,1,..) to a name (a,b,..).Convert a variable number (0,1,..) to a name (a,b,..)Intercalate with a spaceIntercalate with a new lineEIntercalate a dot between the non empty elements of a list of stringsZ[\]^_`   Z[\]^_`SafeQR&Environment used while capturing modelaThe stack of entered typesbThe environment#Run the model capturing computation Enter a typecYReturns True if we have already seen this data type and do not need to analyse it further,Add a new data type model to the environmentLeave current type dabc  dabcSafe69:;QRT ebHelper class, uses Generics to capture the model of a data type Adapted from the Beamable packageClass of types whose model can be calculated Instances are derived automatically, provided that the data type has an instance for   eGiven a type proxy, update the environment with the ADTs referred by it and return the corresponding Q0Helper class used to capture the type parameters#Return the model for the given typeUse the given constructors tree as model for the given type, returns the build type Exported so that it can be used to overwrite default definitions Constructors$Datatypes with multiple constructors>Needed to avoid overlapping instances with (M1 D d (M1 C c a))yDatatypes with single constructor only instance (GModel a, Datatype d, Constructor c) => GModel (M1 D d (M1 C c a)) where6TypeLits are used to represent data type's parameters.efghijklmn  efghijklmnSafe Safe      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY   !"#$%&'()*+,-.123456789:;<=>?@ABCEDFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgho   !"#$%&'()*+,-./0123456789:;<=>?@ABCCDDEFGHIJKKLMNOPQPRSTTUVWXYYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                       ! ! " # $ % & & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > 3 4 5 6 7 8 ? @ A B C D E F G H I J K L M N O P Q R S T U V W X YZZ[\]^_`abcdefghijklm"model-0.4.4-JsAGTPjVgnz9XNwupgO4DDData.Model.TypesData.Model.UtilData.Model.EnvData.Model.Pretty Type.ANat Type.AnalyseData.Model.ClassData.Model.InstancesGHCGenerics Data.Modelbase Data.ProxyProxy*convertible-1.1.1.0-2huR7S7QXmPJFQt2mlnJqBData.Convertible.Baseconvert ConvertResult safeConvert ConvertibleconvErrorMessage convDestTypeconvSourceTypeconvSourceValue ConvertErrortransformers-0.5.2.0Control.Monad.Trans.State.LazyStatepretty-1.1.3.3Text.PrettyPrint.HughesPJClass prettyShow pPrintListpPrint pPrintPrecPrettyA9A8A7A6A5A4A3A2A1A0ANatanatValTypAppAnaErrorsproperMutualGroups mutualGroupstransitiveClosuretoErrorsnoErrorserrorToConvertResulterrorsToConvertResultconvertOrErrorconvertResultToErrorconvertResultToErrors errsInContext inContextdotted$fConvertible[][]$fShowRecStateNameQualNamepkgNamemdlNamelocNameTypeRefTypVarTypRefTypeNTypeTypeConTypeAppFieldsConTreeCon constrName constrFieldsADTdeclNamedeclNumParametersdeclConsTypeEnv TypeModeltypeNametypeEnvHTypeRefHTypeHADT HTypeModelHTypeEnvtypeADTs constructorscontree fieldsTypes fieldsNamesconstructorInfoconTreeTypeMapconTreeNameMapconTreeNameFoldconTreeTypeListconTreeTypeFoldMap adtNamesMaptypeNtypeA nestedTypeNsunVargetHRefqualNamesolveAllsolve$fConvertibleQualName[]$fConvertible[]QualName$fTraversableConTree$fFoldableConTree$fFunctorConTree$fEqType $fOrdType $fShowType $fNFDataType $fGenericType $fFunctorType$fFoldableType$fTraversableType $fEqConTree $fOrdConTree $fShowConTree$fNFDataConTree$fGenericConTree$fEqADT$fOrdADT $fShowADT $fNFDataADT $fGenericADT $fFunctorADT $fFoldableADT$fTraversableADT $fEqTypeModel$fOrdTypeModel$fShowTypeModel$fNFDataTypeModel$fGenericTypeModel $fEqTypeN $fOrdTypeN $fReadTypeN $fShowTypeN $fNFDataTypeN$fGenericTypeN$fFunctorTypeN$fFoldableTypeN$fTraversableTypeN $fEqTypeRef $fOrdTypeRef $fShowTypeRef$fNFDataTypeRef$fGenericTypeRef$fFunctorTypeRef$fFoldableTypeRef$fTraversableTypeRef $fEqQualName $fOrdQualName$fShowQualName$fNFDataQualName$fGenericQualName$fEqName $fOrdName $fShowName $fNFDataName $fGenericName CompactPrettyvarPvarCspacedPvspacedPdottedP$fPrettyPrettyType $fPrettyDoc $fPrettyName$fPrettyQualName $fPrettyTypeN $fPrettyType$fPrettyTypeRef$fPrettyEither $fPretty(,)$fPrettyConTree $fPrettyADT$fPrettyTypeModel$fPrettyCompactPrettyEnvwithEnventerCtxaddDefcloseCtx $fShowEnvModelenvTypeAsTypeasType typeModeluseCT $fGModelK1 $fGModelU1 $fGModel:*: $fGModelM1 $fGModel:+: $fGModelM10 $fGModelM11 $fGModelM12 $fGModelM13 $fModelANat $fAsTypeApp $fAsTypeTyp $fModelEither $fModelMaybe $fModelBool GHC.TypeLitsKnownNat KnownSymbolghc-prim GHC.TypesNatSymbol+*^<=?- CmpSymbolCmpNat TypeError sameSymbolsameNat someSymbolVal someNatVal symbolVal'natVal' symbolValnatValSomeNat SomeSymbol<= ErrorMessageText:<>::$$:ShowTypeErrorRecStateseenerrorsexecRec asQualName GHC.GenericsGenericRepfromtoGeneric1Rep1from1to1Datatype moduleName datatypeName packageName isNewtype ConstructorconName conFixity conIsRecordSelectorselNameselSourceUnpackednessselSourceStrictnessselDecidedStrictnessV1U1Par1unPar1Rec1unRec1K1unK1M1unM1:+:L1R1:*::.:Comp1unComp1RDCSRec0D1C1S1URecUAddrUCharUDoubleUFloatUIntUWorduWord#uInt#uFloat#uDouble#uChar#uAddr#precFixityPrefixInfixFixityIPrefixIInfixI AssociativityLeftAssociativeRightAssociativeNotAssociativeSourceUnpackedness SourceUnpackSourceNoUnpackNoSourceUnpackednessSourceStrictness SourceLazy SourceStrictNoSourceStrictnessDecidedStrictness DecidedLazy DecidedStrict DecidedUnpackMetaMetaDataMetaConsMetaSel PrettyTypeshorter localName prettyADTvarsprintPrettyTypectxenvinCtxGModelgconsgcontreegtypegtypeNasTypePaddCT_unLunRnotThere