h&3F.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred recover-rtti'Show closure tree up to the given depth Used only for internal debugging Safe-Inferred%&' recover-rttiFlattened form of Closure! (with indirection nodes removed)We only include the fields of Closure that we are interested in.TODO: For functions (,  PAPClosure) we don't currently include any information at all. We could potentially do better here. recover-rttiConstructor application recover-rtti FunctionsWe map ,  and H.BCOClosure' all to this. recover-rttiUnrecognized closure type recover-rtti$Force the value to WHNF, if possibleWe cannot force the argument until we know what kind of closure we're dealing with. If this is an unlifted closure, forcing it will result in a ghc runtime crash.  Safe-Inferred ')*1 recover-rtti9Check if the given closure is from a known package/module recover-rttiGeneralization of * that additionally returns nested pointers1 Safe-Inferred )*01T recover-rttiSingleton for  recover-rttiNatural numbers5Intended to be used lifted to the type level; unlike ghc4's type level natural numbers, these are inductive.   Safe-Inferred )*/01 recover-rttiDrop the ends of a list (dropEnds "abcde" == Just ('a',"bcd",'e')  Safe-Inferred)*1   recover-rtti*Tuples with too many fields (more than 62) recover-rttiValid tuple sizesGHC does not support tuples larger than 62 fields. We do allow for tuples of zero size (which we interpret as unit ()!) and tuples of size one (where Tuple '[x] ~ x). recover-rtti$Smaller tuple sizes are always validThis function is primarily useful when doing recursion on tuples: we may have in scope evidence that ('S n)/ is a valid tuple size, and need to know that n is a valid tuple size in order to be able to make the recursive call. recover-rtti&Lift term-level evidence to type-level recover-rtti*Check the given size is a valid tuple size   Safe-Inferred 1 3  Safe-Inferred ()*1  recover-rttiInductive tupleInductive view on tuples that can be constructed with or pattern matched on using  and %. The underlying representation is a true tuple however; for example, ,Tuple '[Int, Bool, Char] ~ (Int, Bool, Char).   Safe-Inferred recover-rttiMutable primitive vector  recover-rttiPrimitive vector (Data.Vector.Primitive)See $5 for why we can't classify elements of these vectors." recover-rttiMutable storage vector (Data.Vector.Storable)See $6 for some details on why we don't infer anything here.$ recover-rttiStorable vector (Data.Vector.Storable)For storable arrays we have no hope of inferring the type of the elements: the elements are not stored as pointers, but rather as " serialized " data through the Storable type class. In order to get at any element, we'd need to have the corresponding Storable instance, but of course we don't have it if we don't have the type.. recover-rtti Functions>We do not try to infer the domain or codomain of the function.0 recover-rttiUser-defined typeWe defer classification of the arguments to the constructor (the type might be recursive, so if we tried to classify all arguments, we might end up unrolling the recursion at the type level). !"#$%&'()*+,-./0  Safe-Inferred )*156 recover-rttiClassifier for primitive typesY recover-rttiGeneralization of mType arguments:o: Classification of " other " types (not explicitly known to the lib) Normally we instantiate this to k&, classifying all unknown types as 0.a%: The type we're actually classifyingk recover-rttiUser-defined typesIf we classify a type as user-defined, we pair the classifier with the original value. This means that a  Classifier is sufficient information for staged inference by client code that may wish to further classify these types given additional domain knowledge (see also  reclassify_).m recover-rtti Classifier#Given a value of some unknown type a, a  Classifier a! will tell you what the type of a is. This is similar to a TypeRep, but since we recover this information from the heap, we have less accurate type information than TypeRep does.>123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn  Safe-Inferred )*1o recover-rtti.Evidence that we can convert between two types.The only actual conversion we ever do is from 0 (aka Any/) to whatever type the reclassification gives. recover-rtti Extension of w to multiple elemsThis is used internally only.w recover-rttiReclassified valuesReclassification can be done by user code which want to take advantage of the classification infrastructure for  recover-rtti but add some additional classification for domain-specific types known only to that client code.When we reclassify a value, a value that might previously be classified as  UserDefined may now be classified as some concrete type; therefore we compute a classifier for a potentially  different> type along with evidence that we can coerce between the two.z recover-rttiLift w to the top-levelGiven a classifier with user-defined classifiers at the levels, along with coercion functions, leave the user-defined classifiers in place but lift the coercion function to the top-level.{ recover-rtti7Coerce, given some evidence that the coercion is sound. ovprstuqwxyz{ Safe-Inferred)*/18|}~ Safe-Inferred'()*15!& recover-rtti"Bundle a value with its classifier recover-rttiClassify a value#Given a value of some unknown type a and a classifier  Classifier a, it should be sound to coerce the value to the type indicated by the classifier.This is also the reason not all values can be classified; in particular, we cannot classify values of unlifted types, as for these types coercion does not work (this would result in a ghc runtime crash). recover-rtti)Classify the arguments to the constructor1Additionally returns the constructor name itself. recover-rttiShow any valueThis shows any value, as long as it's not unlifted. The result should be equal to show instances, with the following caveats:User-defined types (types not explicitly known to this library) with a custom Show instance will still be showable, but the result will be what the derived show instance would have done.Record field names are not known at runtime, so they are not shown.UNPACKed data is not visible to this library (if you compile with -O0 ghc will not unpack data, so that might be a workaround if necessary).4If classification fails, we show the actual closure. recover-rtti2Show the classified value (without the classifier) recover-rttiGet the length of the array recover-rtti7Get the first element (provided the array is not empty) Safe-Inferred*4 recover-rtti$Add level of indirection on the heap(Advanced users only, for most use cases this should not be necessary.)Type recovery in  recover-rtti (through ) works by looking at the values on the heap. For example, if we see a list, we then look at the first element of that list (if any), and if that element happens to be an , the inferred type is [Int]. When we show such a list (3), every element of the list is interpreted as an ', without doing further type recovery.This works for normal use cases, but fails in low-level code that uses Any to squeeze values of different types into a data structure not designed for that purpose. For example, consider data T f = T [f Any] If we call  on a T value with elements of different types in the list, we get some unexpected results:  anythingToString (T [unsafeCoerce (1 :: Int), unsafeCoerce False]) == "T [1,14355032]"8The reason is that the type of the list was inferred as [Int], and hence the ) was subsequently also interpreted as an . helps to resolve the problem. There are ways in which it can be used. First, we can derive the following entirely reasonable  instance for T: *deriving instance Show a => Show (T (K a)) We then get  show (T [K $ BoxAnything (1 :: Int), K $ BoxAnything False]) == "T [K 1,K False]"Alternatively, we can omit the  instance for T, to get  anythingToString (T [K $ BoxAnything (1 :: Int), K $ BoxAnything False]) == "T [BoxAnything 1,BoxAnything False]"6For this second use case to work, it is critical that  is a datatype, not a newtype, so that it actually appears on the heap. recover-rttiDeriving-via support for 8If for debugging purposes you want to temporarily add a 0 instance to an arbitrary datatype in terms of , you can do so using 7data T = MkT ... deriving Show via AnythingToString TThis is equivalent to saying /instance Show T where show = anythingToString recover-rttiLike  , but using  recover-rttiLike  , but using  Safe-Inferred )*1, recover-rtti'Check that two classifiers are the sameIf they are the same, additionally return a proof that that means the types they classify must be equal (note that equality on the classifiers is strictly stronger than equality on the types: for example, non-empty and empty lists have different classifiers, but classify the same type).$This is defined on the general type Y rather than on m because different user-defined types may both be classified as  UserDefined yet not be equal to each other Safe-Inferred,   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnovprstuqwxyz{|}~m6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXklYZ[\]^_`abcdefghij34512,-()*+./&'$%"# !n0}~|wxyzovprstuq{     !"# $ % % & ' ( ) * + + , , - - . . / / 0 0 1 1 2 2 3 3 4 5 5 6 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m m n o p q r p s t u v w w x y z{|}~       4 )recover-rtti-0.4.2-D1bVrxrSFVNG0mSrjCqcUaDebug.RecoverRTTI.ClosureTreeDebug.RecoverRTTIDebug.RecoverRTTI.ClassifyDebug.RecoverRTTI.FlatClosureDebug.RecoverRTTI.ModulesDebug.RecoverRTTI.NatDebug.RecoverRTTI.UtilDebug.RecoverRTTI.Tuple.Size!Debug.RecoverRTTI.Tuple.RecursiveDebug.RecoverRTTI.TupleDebug.RecoverRTTI.WrappersDebug.RecoverRTTI.ClassifierDebug.RecoverRTTI.ReclassifyDebug.RecoverRTTI.ConstraintDebug.RecoverRTTI.DebuggingDebug.RecoverRTTI.CheckSameshowClosureTreeLengthKnownNatsingNatSNatSZSSNatZSSomemapSomeTooBig IsValidSize isValidSize ValidSizesmallerIsValid liftValidSize toValidSizeTuple WrappedTuple unwrapTupleTConsTNil tupleFromNP tupleToNPSomePrimitiveVectorMSomePrimitiveVectorSomeStorableVectorMSomeStorableVectorSomePrimArrayMSomeTVarSomeMVar SomeSTRefSomeFun UserDefinedElemsElemNoElemPrimClassifierC_BoolC_CharC_DoubleC_FloatC_IntC_Int16C_Int8C_Int32C_Int64 C_Integer C_OrderingC_UnitC_WordC_Word8C_Word16C_Word32C_Word64C_String C_BS_Strict C_BS_Lazy C_BS_Short C_Text_Strict C_Text_LazyC_ValueC_STRefC_TVarC_MVarC_FunC_IntSet C_Prim_ArrayMC_Vector_StorableC_Vector_StorableMC_Vector_PrimitiveC_Vector_PrimitiveM Classifier_C_PrimC_OtherC_MaybeC_EitherC_ListC_RatioC_SetC_MapC_IntMap C_SequenceC_Tree C_HashSet C_HashMap C_HM_Array C_Prim_ArrayC_Vector_BoxedC_Tuple IsUserDefined Classifier mapClassifierFromUsrIdAbsurdF1F2FNCompose Reclassified reclassify_distribReclassified coerceFromUsrClassifiedSatisfies PrimSatisfies primSatisfiesclassifiedSatisfies ClassifiedElemUKElemKUElemUUElemKKElemUElemKclassifyfromUserDefinedanythingToStringcanShowClassified canShowPrimcanShowClassified_$fShowUserDefined$fShowClassified $fShowSome BoxAnythingAnythingToString traceAnythingtraceAnythingIdsamePrimsameClassifier_sameElem sameElems FlatClosure FunClosure ConstrClosureghc-heap-9.2.4GHC.Exts.Heap.Closures PAPClosure OtherClosure tryForceBoxBoxasBoxmodlnamepkgptrArgsgetBoxedClosureData inKnownModuleinKnownModuleNested IsKnownPkgsingPkg KnownModuleGhcTypesGhcTupleGhcIntGhcWordGhcSTRefGhcMVar GhcConcSyncGhcMaybeGhcReal DataEitherDataByteStringInternalDataByteStringLazyInternalDataByteStringShortInternalDataTextInternalDataTextInternalLazyGhcIntegerType GhcNumIntegerDataSetInternalDataMapInternalDataIntSetInternalDataIntMapInternalDataSequenceInternalDataTreeDataAesonTypesInternalDataHashMapInternalDataHashMapInternalArray DataVectorDataVectorStorableDataVectorStorableMutableDataVectorPrimitiveDataVectorPrimitiveMutableDataPrimitiveArrayKnownPkg PkgGhcPrimPkgBase PkgByteStringPkgTextPkgIntegerWiredIn PkgGhcBignum PkgContainersPkgAesonPkgUnorderedContainers PkgVector PkgPrimitivenatValdropEnds VerifiedSize verifySizeconsunconsPairWisePNilPConsmapTupleReclassifiedElemsshowClassifiedValueclassifyArrayLikeghc-prim GHC.TypesIntBoolbaseGHC.ShowShow Debug.Trace traceShow traceShowId