definition module StdDynamicTypeIO from StdDynamicTypes import :: PredefType, :: TypeDef`, :: UniversalTypeID from StdDynamic import :: TypeCodeConstructor from StdMaybe import :: Maybe :: Type = Predefined PredefType | NonPredefined TypeDef` :: TypeState :: TypeRef // create initial type state CreateTypeState :: !Dynamic -> TypeState // convert ConstructorID to a type TypeConstructorIDToType :: !Int !TypeState -> Type // convert TypeCodeConstructor to Type TypeCodeConstructorToType :: !TypeCodeConstructor !TypeState -> Type // using the descriptor address of a constructor, find its type definition FindTypeDef :: !Int !TypeState -> Maybe TypeRef // fetches all typedef`s GetAllTypedefs :: !.TypeState -> .[TypeDef`] // fetches the appropriate typedef` GetTypeDef :: !TypeRef !TypeState -> TypeDef` // returns the TypeCodeConstructors associated with each UniversalTypeID // WARNING: This conversion fails if at least one of the universal type // identification is dangling. A reference can be dangling when // universal type ids are stored and a disk garbage collection // has been done before its next use. UniversalTypeID_to_TypeCodeConstructor_address :: [UniversalTypeID] -> [(!TypeCodeConstructor,!UniversalTypeID)]