Îõ³h&#!ƒÇ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF(c) 2017-2022 KowainikMPL-2.0Kowainik StablePortableNone #$&'(./0<ÇÉÊÔ×Ùìò typerep-mapExistential wrapper around G indexed by f type parameter. Useful for ! structure creation form list of s. typerep-map= is a heterogeneous data structure similar in its essence to ÿ with types as keys, where each value has the type of its key. In addition to that, each value is wrapped in an interpretation f.Here is an example of using H, as an interpretation, with a comparison to :   I (H I )  HÝ --------------------------- --------------------- "Int" -> Just "5" J0 -> Just 5 "Bool" -> Just "True" K -> Just L% "Char" -> Nothing M -> Nothing The runtime representation of % is an array, not a tree. This makes  significantly more efficient. typerep-mapan unsafe constructor for  typerep-map$first components of key fingerprints typerep-map%second components of key fingerprints typerep-mapvalues stored in the map  typerep-map typerep keys  typerep-mapReturns the list of Ns from .  typerep-mapA  with no values stored in it.size empty == 0member @a empty == False  typerep-map Construct a  with a single element.size (one x) == 1"member @a (one (x :: f a)) == True  typerep-mapInsert a value into a Ö. TypeRepMap optimizes for fast reads rather than inserts, as a trade-off inserts are O(n).size (insert v tm) >= size tm(member @a (insert (x :: f a) tm) == True typerep-mapDelete a value from a .ÚTypeRepMap optimizes for fast reads rather than modifications, as a trade-off deletes are O(n) , with an  O(log(n))6 optimization for when the element is already missing.size (delete @a tm) <= size tm!member @a (delete @a tm) == False7tm = delete @Bool $ insert (Just True) $ one (Just 'a')size tm1member @Bool tmFalsemember @Char tmTrue typerep-map‘Update a value at a specific key with the result of the provided function. When the key is not a member of the map, the original map is returned.Åtrmap = fromList @(TypeRepMap Identity) [WrapTypeable $ Identity "a"].lookup @String $ adjust (fmap (++ "ww")) trmapJust (Identity "aww") typerep-mapŽUpdates a value at a specific key, whether or not it exists. This can be used to insert, delete, or update a value of a given type in the map.áfunc = (\case Nothing -> Just (Identity "new"); Just (Identity s) -> Just (Identity (reverse s)))!lookup @String $ alter func emptyJust (Identity "new")Êtrmap = fromList @(TypeRepMap Identity) [WrapTypeable $ Identity "helllo"]!lookup @String $ alter func trmapJust (Identity "olleh") typerep-mapMap over the elements of a .0tm = insert (Identity True) $ one (Identity 'a')lookup @Bool tmJust (Identity True)lookup @Char tmJust (Identity 'a')$tm2 = hoist ((:[]) . runIdentity) tmlookup @Bool tm2 Just [True]lookup @Char tm2Just "a" typerep-mapThe union of two 6s using a combining function for conflicting entries. O(n + m) typerep-mapThe (left-biased) union of two s in O(n + m)Æ. It prefers the first map when duplicate keys are encountered, i.e.  ==  const. typerep-mapThe  of two s using a combining function O(n + m) typerep-mapThe intersection of two Ðs. It keeps all values from the first map whose keys are present in the second. O(n + m) typerep-map3Check if a value of the given type is present in a .!member @Char $ one (Identity 'a')True!member @Bool $ one (Identity 'a')False typerep-map&Lookup a value of the given type in a .0x = lookup $ insert (Identity (11 :: Int)) emptyx :: Maybe (Identity Int)Just (Identity 11)x :: Maybe (Identity ())Nothing typerep-map Get the amount of elements in a . typerep-mapReturn the list of O from the keys. typerep-mapÇReturn the list of keys by wrapping them with a user-provided function. typerep-mapÒReturn the list of key-value pairs by wrapping them with a user-provided function. typerep-map'Binary searched based on this article  Æhttp://bannalia.blogspot.com/2015/06/cache-friendly-binary-search.html3 with modification for our two-vector search case.% typerep-map6Efficiently get sorted triples from a map in O(n) time9We assume the incoming TypeRepMap is already sorted into Œ order using fromSortedList. Then we can construct the index mapping from the "cached" ordering into monotonically increasing order using ,( with the length of the TRM. This takes ÞO(n). We then pull those indexes from the source TRM to get the sorted triples in a total of O(n).- typerep-mapñCheck that invariant of the structure holds. The structure maintains the following invariant. For each element A at index i: if there is an element B at index 2*i+1 , then B < A.if there is an element C at index 2*i+2 , then A < C.0 typerep-mapUses  to combine s.1 typerep-mapShows only keys.3 typerep-mapfromList . toList == 'id'Creates  from a list of s.Ëshow $ fromList [WrapTypeable $ Identity True, WrapTypeable $ Identity 'a']TypeRepMap [Bool, Char].   !"#$%&'()*+,-.   !"#$%&'()*+,-(c) 2017-2022 KowainikMPL-2.0Kowainik StablePortableNone #$<Ùìâ  (c) 2017-2022 KowainikMPL-2.0Kowainik StablePortableNone  #$<ÔÙì![5 typerep-map5 is a special case of  when the interpretation is P.6 typerep-mapA 5 with no values stored in it.size empty == 0member @a empty == False7 typerep-map Construct a 5 with a single element.size (one x) == 1 member @a (one (x :: a)) == True8 typerep-mapInsert a value into a 5Ð. TMap optimizes for fast reads rather than inserts, as a trade-off inserts are O(n).size (insert v tm) >= size tm&member @a (insert (x :: a) tm) == True9 typerep-mapDelete a value from a 5.ÔTMap optimizes for fast reads rather than modifications, as a trade-off deletes are O(n) , with an  O(log(n))6 optimization for when the element is already missing.size (delete @a tm) <= size tm!member @a (delete @a tm) == False)tm = delete @Bool $ insert True $ one 'a'size tm1member @Bool tmFalsemember @Char tmTrue: typerep-mapThe union of two 5s using a combining function.; typerep-mapThe (left-biased) union of two 5Çs. It prefers the first map when duplicate keys are encountered, i.e. ; == : const.< typerep-mapThe intersection of two 5s using a combining function. O(n + m)= typerep-mapThe intersection of two 5Ðs. It keeps all values from the first map whose keys are present in the second. O(n + m)> typerep-map&Lookup a value of the given type in a 5.%x = lookup $ insert (11 :: Int) emptyx :: Maybe IntJust 11 x :: Maybe ()Nothing? typerep-map3Check if a value of the given type is present in a 5.member @Char $ one 'a'Truemember @Bool $ one 'a'False@ typerep-map Get the amount of elements in a 5.A typerep-mapReturns the list of O s from keys.B typerep-mapÇReturn the list of keys by wrapping them with a user-provided function.C typerep-mapÒReturn the list of key-value pairs by wrapping them with a user-provided function.D typerep-mapMap a function over the values.E typerep-map8Update a value with the result of the provided function.F typerep-map‘Updates a value at a specific key, whether or not it exists. This can be used to insert, delete, or update a value of a given type in the map.56789:;<=>?@ABCDEF56789:;<=DEF>?@ABCÑ       !"#$%&'()*+,-./0123456789 !":;<=;>?;@ABCDBCEBCFBCG;HI;<J;KLÍtyperep-map-0.5.0.0-inplaceData.TypeRepMap.Internal Data.TMapData.MapMapData.TypeRepMap WrapTypeable ArgKindOfKindOf TypeRepMap fingerprintAs fingerprintBstrAnystrKeystoFingerprintsemptyoneinsertdelete deleteFirstadjustalterhoisthoistA hoistWithKey unionWithunionintersectionWith intersectionmemberlookupsizekeyskeysWith toListWithcachedBinarySearchtoAnyfromAny anyToTypeReptypeFp toTriplestoSortedTriplesnubByFstfst3calcFp fromTriplesfromSortedTriplesfromSortedListgenerateOrderMappinginvariantCheck$fEqTypeRepMap$fMonoidTypeRepMap$fSemigroupTypeRepMap$fShowTypeRepMap$fNFDataTypeRepMap$fIsListTypeRepMap$fShowWrapTypeableTMapmapbaseData.Typeable.InternalTypeable GHC.MaybeMaybeGHC.BaseStringghc-prim GHC.TypesIntBoolTrueCharGHC.Fingerprint.Type Fingerprint SomeTypeRepData.Functor.IdentityIdentity