úÎfÇb{0      !"#$%&'()*+,-./None012012012portable provisionalatzeus@gmail.orgNone(A monad that can be used to create keys < Keys cannot escape the monad, analogous to the ST Monad.  Can be used instead of the  function if you . need an statically unknown number of keys. 2The applicative instance is more non-strict than  the standard 3: let hang = getKey >> hang , in snd $ runIdentity $ runKeyT $ pure (,)  * hang  * (getKey >> return 2)  does not hang, but with 3 it does. The scope of top-level keys. The datatype of Keys.  x+ The scope of this key. This can either be ! for top-level keys created with  or 2 an existential type for keys introduced by  (or with the Key monad ). a4 The type of things that can be sorted at this key.  For example,  Key T Int5 is a top-level key that can be used to store values  of type Int in a heterogenous map. O(1)%. Scopes a key to the given function G The key cannot escape the function (because of the existential type). OThe implementation actually *creates* a key, but because the key cannot escape  the given function f-, there is no way to observe that if we run   withKey f: twice, that it will get a different key the second time. O(1). Create a new top-level key. Obtain a key in the key monad Split of a keyT computation. 2As an analogy, think of a random number generator N some random number generator can be split, from one random number generator E we obtain two distinct random number generator that are unrelated. GThe KeyT monad gives us access to a name source, this operation allows F us to split the name source. The generated name from both this and O the split off computation have the same scope, but are otherwise underlated. ;Notice that the sharing of the same scope is not a problem 6 because the monad ensures referential transparency. ARun a key monad. Existential type makes sure keys cannot escape. 456789:;<=>?@ABCDEF ?4567:98;>=<?@ABCDEFportable provisionalatzeus@gmail.orgNone Make an Untypeable value :Project (i.e. cast) an untypeable value with a given key.  G    G None  portable provisionalatzeus@gmail.orgNone The type of hetrogenous maps. O(log n). Find the value at a key.  Calls H$ when the element can not be found. Same as . O(1). Is the map empty? O(1)%. The number of elements in the map. O(log n)(. Lookup the value at a key in the map. 4The function will return the corresponding value as (I value),  or J if the key isn't in the map. O(log n)+. Is the key a member of the map? See also . O(log n)/. Is the key not a member of the map? See also . KO(log n). Find the value at a key.  Calls H$ when the element can not be found. O(log n). The expression ( def k map) returns  the value at key k or returns default value def ! when the key is not in the map. O(1). The empty map. O(1). A map with a single element. O(log n)). Insert a new key and value in the map. C If the key is already present in the map, the associated value is # replaced with the supplied value.  is equivalent to   L. O(log n)=. Insert with a function, combining new value and old value.   f key value mp ( will insert the pair (key, value) into mp if key does @ not exist in the map. If the key does exist, the function will  insert the pair (key, f new_value old_value). O(log n)?. Delete a key and its value from the map. When the key is not 4 a member of the map, the original map is returned. O(log n)M. Update a value at a specific key with the result of the provided function.  When the key is not 4 a member of the map, the original map is returned. O(log n). The expression ( f k map) updates the value x  at k (if it is in the map). If (f x) is J, the element is  deleted. If it is (I y ), the key k is bound to the new value y. O(log n). The expression ( f k map) alters the value x at k, or absence thereof.  7 can be used to insert, delete, or update a value in a Map.  In short :  k ( f k m) = f ( k m). The union of a list of maps:  ( == M  ). O(n+m).  The expression ( t1 t2!) takes the left-biased union of t1 and t2.  It prefers t1& when duplicate keys are encountered. O(n+m). Difference of two maps. B Return elements of the first map not existing in the second map. O(n+m). Intersection of two maps. B Return data in the first map for the keys existing in both maps. NO(n). Remove dead values from map. 5An entry into an HMap does not keep the value alive 0 if the key is not alive. After all, if the key 6 is dead, then there is no way to retrieve the value! =Hence, a HMap can have elements which can never be accessed ; again. This operation purges such elements from the given 7 map. Notice that this does change the size of the map  and is hence in the IO monad.  O KP N     O KP Nportable provisionalatzeus@gmail.orgNone!#The type of hetrogenous key sets. "O(1) Construct an empty key set. #O(1)( Construct a set with a single element. $O(n+m)= Construct a key set containing all elements from both sets. ATo obtain good performance, the smaller set must be presented as  the first argument. %EConstruct a key set containing all elements from a list of key sets. &O(1) Return Q if this key set is empty, R otherwise. 'O(n), Return the number of elements in this set. ( O(min(n,W)) Return Q' if the given value is present in this  set, R otherwise. ) O(min(n,W))& Add the specified value to this set. * O(min(n,W))- Remove the specified value from this set if  present. +O(n): Difference of two sets. Return elements of the first set  not existing in the second. ,O(n); Intersection of two sets. Return elements present in both  the first set and the second. -O(n)&. Does the map carry any of the keys? .O(n)0. Do the keyset and the map have the same keys? /O(n)0. Remove the keys from the keyset from the map. !S"#$%&'()*+,-./!"#$%&'()*+,-./!"#$%&'()*+,-./!S"#$%&'()*+,-./T      !"#$%&'(%$ &')*+,,-./01234256789:;<=>?@A.BC.DE.DFG.HI.JKLMNOPNOQ(R HMap-1.1.9 Data.HKeyData.Untypeable Data.HMap Data.HKeySet Data.HideTypeData.HKeyPrivateKeyTKeyMTHKeywithKey createKeygetKey keyTSplitrunKeyT UntypeableinjectprojectHMap!\\nullsizelookupmember notMemberfindWithDefaultempty singletoninsert insertWithdeleteadjustupdatealterunionsunion difference intersectionHKeySetoverlapsameKeys removeKeysHideTypeunsafeFromHideTypebase Control.MonadapgetKTBindTermMPrimReturnGDSplitGetKeyLiftKey interpret$fMonadTransKeyT $fMonadKeyT$fApplicativeKeyT $fFunctorKeyT $fMonadTermM$fHashableUniqueGHC.Errerror Data.MaybeJustNothingfindGHC.BaseconstGHC.Listfoldlpurge unsafeMKWeakghc-prim GHC.TypesTrueFalse