úÎ#VÝS:      !"#$%&'()*+,-./0123456789(c) 2017-2020 KowainikMPL-2.0Kowainik <xrom.xkov@gmail.com>None"#%&'-./;FHSVXkq9´ typerep-mapExistential wrapper around : 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 ;, as an interpretation, with a comparison to :   < (; < )  ;] --------------------------- --------------------- "Int" -> Just "5" =0 -> Just 5 "Bool" -> Just "True" > -> Just ?% "Char" -> Nothing @ -> 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 As 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 .size (insert v tm) >= size tm(member @a (insert (x :: f a) tm) == True  typerep-mapDelete a value from a .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.Etrmap = fromList @(TypeRepMap Identity) [WrapTypeable $ Identity "a"].lookup @String $ adjust (fmap (++ "ww")) trmapJust (Identity "aww") 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 s using a combining function. typerep-mapThe (left-biased) union of two Gs. It prefers the first map when duplicate keys are encountered, i.e.  ==  const. 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 B from the keys. typerep-map'Binary searched based on this article  Fhttp://bannalia.blogspot.com/2015/06/cache-friendly-binary-search.html3 with modification for our two-vector search case.% typerep-mapsCheck that invariant of the structure is hold. 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.( typerep-mapUses  to combine s.) typerep-mapShows only keys.+ typerep-mapfromList . toList == 'id'Creates  from a list of s.Kshow $ fromList [WrapTypeable $ Identity True, WrapTypeable $ Identity 'a']TypeRepMap [Bool, Char]&  !"#$%&   !"#$%(c) 2017-2020 KowainikMPL-2.0jKowainik <xrom.xkov@gmail.com> A version of 'Data.TMap.TMap' parametrized by an interpretation @f@. ThisNone"#;Xk=y  (c) 2017-2020 KowainikMPL-2.0Kowainik <xrom.xkov@gmail.com>None "#;SXkR± - typerep-map- is a special case of  when the interpretation is C.. 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 :: a)) == True0 typerep-mapInsert a value into a -.size (insert v tm) >= size tm&member @a (insert (x :: a) tm) == True1 typerep-mapDelete a value from a -.size (delete @a tm) <= size tm!member @a (delete @a tm) == False)tm = delete @Bool $ insert True $ one 'a'size tm1member @Bool tmFalsemember @Char tmTrue2 typerep-mapThe union of two -s using a combining function.3 typerep-mapThe (left-biased) union of two -Gs. It prefers the first map when duplicate keys are encountered, i.e. 3 == 2 const.4 typerep-map&Lookup a value of the given type in a -.%x = lookup $ insert (11 :: Int) emptyx :: Maybe IntJust 11 x :: Maybe ()Nothing5 typerep-map3Check if a value of the given type is present in a -.member @Char $ one 'a'Truemember @Bool $ one 'a'False6 typerep-map Get the amount of elements in a -.7 typerep-mapReturns the list of B s from keys.8 typerep-mapMap a function over the values.9 typerep-map8Update a value with the result of the provided function. -./0123456789 -./0123894567D      !"#$%&'()*+,-./012345367389:;<:;=:;>:;?3@A34B3CDEtyperep-map-0.3.3.0-inplaceData.TypeRepMap.Internal Data.TMapData.MapMapData.TypeRepMap WrapTypeableKindOf TypeRepMap fingerprintAs fingerprintBstrAnystrKeystoFingerprintsemptyoneinsertdeleteadjusthoisthoistA hoistWithKey unionWithunionmemberlookupsizekeyscachedBinarySearchtoAnyfromAny anyToTypeReptypeFp toTriples deleteByFstnubByFstfst3 wrapTypeablecalcFp fromTriplesfromSortedListinvariantCheck$fEqTypeRepMap$fMonoidTypeRepMap$fSemigroupTypeRepMap$fShowTypeRepMap$fNFDataTypeRepMap$fIsListTypeRepMap$fShowWrapTypeableTMapmapbaseData.Typeable.InternalTypeable GHC.MaybeMaybeGHC.BaseStringghc-prim GHC.TypesIntBoolTrueCharGHC.Fingerprint.Type Fingerprint SomeTypeRepData.Functor.IdentityIdentity