t      !"#$%&'()*+,-./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 application8Abstract 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)8 :: App (App (Typ (Either A0 A1)) (Typ Int)) (Typ Char)undefined :: Ana ([(Bool,())])undefined :: Ana ([(Bool,())])B :: App (Typ [A0]) (App (App (Typ (A0, A1)) (Typ Bool)) (Typ ()))- SafeA list of error messages9Return the groups of entities that are mutually dependentImutualGroups Just (M.fromList [("a",["b","c"]),("b",["a","c"]),("c",[])])[["c"],["a","b"]]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"]BExtract a Right value from an Either, throw an error if it is Left Safe234579;+ Simple nameA fully qualified Haskell name"A reference to a type# Type variable$Type reference%>Another representation of a type, sometime easier to work with'A type(Type constructor (Bool,Maybe,..))Type application*+Constructors are assembled in a binary tree,Constructor 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 ?--The constructor name, unique in the data type.{Constructor fields, they can be either unnamed (Left case) or named (Right case) If they are named, they must all be named/(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 9)1'The name of the data type (for example Bool for  data Bool)2?The number of type parameters/variable (up to a maximum of 255)3The constructors, if present4eA map of all the ADTs that are directly or indirectly referred by a type, indexed by a type reference5KThe 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 9)UexRef: type used to represent a reference to a type in the type name (for example )7.The type application corresponding to the type8,The environment in which the type is defined9Reference to an Haskell Type: Haskell Type; Haskell ADT<Haskell TypeModel=Haskell Environment>!The ADTs defined in the TypeModel?3Return the list of constructors in definition order@Return just the field typesA=Return just the field names (or an empty list if unspecified)BmReturn the binary encoding and parameter types of a constructor The binary encoding is the sequence of Left (False) and Right (True) turns needed to reach the constructor from the constructor tree root. constructorInfo :: Eq consName => consName -> ADT name consName ref -> Maybe ([Bool], [Type ref]) constructorInfo consName dt = declCons dt >>= ((first reverse  $ ) . loc [])CJMap on the constructor types (used for example when eliminating variables)D!Map over a constructor tree namesE+Extract list of types in a constructor treeF)Fold over the types in a constructor treeG4Map over the names of an ADT and of its constructorsHConvert from Type to TypeNIConvert from TypeN to TypeJoRemove variable references (for example if we know that a type is fully saturated and cannot contain variables)KExtract referenceL2Return the qualified name, minus the package name.MESolve all references in a data structure, using the given environmentNESolve a key in an environment, returns an error if the key is missing: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST      !"#$%&'()*+,-./0123456789:;< !"#$%&'()*,+.-/0123456789:;<=>?@ABCDEFGHIJKLMN656784>/0123*+,-.'()%&"#$ !LGHI?BDCEF@A=<;:9NMJK% !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTSafe9:;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,..)Separate with a spaceSeparate with a new lineIntercalate with a dot=>?@ABC  =>?@ABCSafeQR&Environment used while capturing modelDThe stack of entered typesEThe environment#Run the model capturing computation Enter a typeFYReturns 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 GDEFGDEFSafe69:;QRT HbHelper 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 :0Helper 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.HIJKLMNOPQHIJKLMNOPQSafe Safe      !"#$%&'()*+,-./0123456789:;< !"#$%&'()*,+.-/0123456789:;<=>?@ABCDEFGHIJKLMNR   !"#$%&'()*+,,--./012344567898:;<<=>?@AABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                             ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ;<<=>?@ABCDEFGHIJKLMNO model-0.3-A2rozqcGuQN4U385Cv7TajData.Model.TypesData.Model.PrettyData.Model.Env Type.ANat Type.AnalyseData.Model.UtilData.Model.ClassData.Model.InstancesGHCGenerics Data.Modelbase Data.ProxyProxypretty-1.1.3.3Text.PrettyPrint.HughesPJClass prettyShow pPrintListpPrint pPrintPrecPrettytransformers-0.5.2.0Control.Monad.Trans.State.LazyStateA9A8A7A6A5A4A3A2A1A0ANatanatValTypAppAnaErrors mutualGroupstransitiveClosure$fShowRecStateNameQualNamepkgNamemdlNamelocNameTypeRefTypVarTypRefTypeNTypeTypeConTypeAppConTreeCon constrName constrFieldsADTdeclNamedeclNumParametersdeclConsTypeEnv TypeModeltypeNametypeEnvHTypeRefHTypeHADT HTypeModelHTypeEnvtypeADTs constructors fieldsTypes fieldsNamesconstructorInfoconTreeTypeMapconTreeNameMapconTreeTypeListconTreeTypeFoldMap adtNamesMaptypeNtypeAunVargetHRefqualNamesolveAllsolve$fStringLikeName$fStringLike[]$fStringLikeQualName$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 CompactPrettyvarPspacedPvspacedPdotted$fPrettyPrettyType $fPrettyDoc $fPrettyName$fPrettyQualName $fPrettyTypeN $fPrettyType$fPrettyTypeRef$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:<>::$$:ShowTypeunsafelyRecStateseenerrorsexecRec 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