ϊΞξWεΤ†      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…portable provisionallibraries@haskell.org Safe-InferredD'The number of occurences of an element A multiset of values a. , The same value can occur multiple times. O(n+m). See . O(1). Is this the empty multiset? O(n)*. The number of elements in the multiset. O(1)3. The number of distinct elements in the multiset. O(log n)". Is the element in the multiset? O(log n)&. Is the element not in the multiset? O(log n)8. The number of occurences of an element in a multiset. O(1). The empty mutli set. O(1) . Create a singleton mutli set. O(log n)#. Insert an element in a multiset. O(log n);. Insert an element in a multiset a given number of times. 9Negative numbers remove occurences of the given element. O(log n)+. Delete a single element from a multiset. O(log n)=. Delete an element from a multiset a given number of times. 6Negative numbers add occurences of the given element. O(log n)7. Delete all occurences of an element from a multiset. O(n+m)9. Is this a proper subset? (ie. a subset but not equal). O(n+m). Is this a subset?  (s1 ` isSubsetOf` s2) tells whether s1 is a subset of s2. O(log n)%. The minimal element of a multiset. O(log n)%. The maximal element of a multiset. O(log n). Delete the minimal element. O(log n). Delete the maximal element. O(log n)0. Delete all occurences of the minimal element. O(log n)0. Delete all occurences of the maximal element. O(log n)'. Delete and find the minimal element. 2 deleteFindMin set = (findMin set, deleteMin set) O(log n)'. Delete and find the maximal element. 2 deleteFindMax set = (findMax set, deleteMax set) O(log n)1. Retrieves the minimal element of the multiset, * and the set with that element removed.  fail0s (in the monad) when passed an empty multiset. O(log n)1. Retrieves the maximal element of the multiset, * and the set with that element removed.  fail0s (in the monad) when passed an empty multiset. #The union of a list of multisets: ( == †   ). O(n+m)F. The union of two multisets. The union adds the occurences together. &The implementation uses the efficient  hedge-union algorithm. * Hedge-union is more efficient on (bigset  smallset). O(n+m). The union of two multisets. : The number of occurences of each element in the union is P the maximum of the number of occurences in the arguments (instead of the sum). &The implementation uses the efficient  hedge-union algorithm. * Hedge-union is more efficient on (bigset  smallset). O(n+m) . Difference of two multisets. & The implementation uses an efficient hedge algorithm comparable with  hedge-union. O(n+m)%. The intersection of two multisets. E Elements of the result come from the first multiset, so for example  & import qualified Data.MultiSet as MS  data AB = A | B deriving Show ( instance Ord AB where compare _ _ = EQ $ instance Eq AB where _ == _ = True @ main = print (MS.singleton A `MS.intersection` MS.singleton B, @ MS.singleton B `MS.intersection` MS.singleton A) prints  (fromList [A] ,fromList [B]). !O(n)2. Filter all elements that satisfy the predicate. "O(n)P. Partition the multiset into two multisets, one with all elements that satisfy 1 the predicate and one with all elements that don't satisfy the predicate.  See also >. # O(n*log n).  # f s& is the multiset obtained by applying f to each element of s. $O(n). The $ f s == # f s, but works only when f is strictly monotonic.   The precondition is not checked.  Semi-formally, we have: . and [x < y ==> f x < f y | x <- ls, y <- ls] 5 ==> mapMonotonic f s == map f s  where ls = toList s %O(n). Map and collect the ‡ results. &O(n). Map and separate the ˆ and ‰ results. 'O(n)F. Apply a function to each element, and take the union of the results (O(n)F. Apply a function to each element, and take the union of the results )O(n)*. The monad join operation for multisets. *O(n)2. The monad bind operation, (>>=), for multisets. +O(t)@. Fold over the elements of a multiset in an unspecified order. ŠO(t). Post-order fold. ,O(n)>. Fold over the elements of a multiset with their occurences. -O(t). The elements of a multiset. .O(n)R. The distinct elements of a multiset, each element occurs only once in the list. ' distinctElems = map fst . toOccurList /O(t).. Convert the multiset to a list of elements. 0O(t)9. Convert the multiset to an ascending list of elements. 1 O(t*log t)-. Create a multiset from a list of elements. 2O(t):. Build a multiset from an ascending list in linear time.  :The precondition (input list is ascending) is not checked. 3O(n)O. Build a multiset from an ascending list of distinct elements in linear time.  CThe precondition (input list is strictly ascending) is not checked. 4O(n)+. Convert the multiset to a list of element/occurence pairs. 5O(n)6. Convert the multiset to an ascending list of element/occurence pairs. 6 O(n*log n)*. Create a multiset from a list of element/occurence pairs. 7O(n)4. Build a multiset from an ascending list of element/ occurence pairs in linear time.  :The precondition (input list is ascending) is not checked. 8O(n)5. Build a multiset from an ascending list of elements/7occurence pairs where each elements appears only once.  CThe precondition (input list is strictly ascending) is not checked. 9O(1). Convert a multiset to a ‹) from elements to number of occurrences. :O(n) . Convert a ‹- from elements to occurrences to a multiset. ;O(1) . Convert a ‹- from elements to occurrences to a multiset.  Assumes that the ‹' contains only values larger than one.  3The precondition (all elements > 1) is not checked. <O(n). Convert a multiset to a Œ, removing duplicates. =O(n) . Convert a Œ to a multiset. >O(log n). The expression (> x set ) is a pair  (set1,set2)  where all elements in set1 are lower than x and all elements in  set2 larger than x. x is not found in neither set1 nor set2. ?O(log n) . Performs a > but also returns the number of 6 occurences of the pivot element in the original set. @O(n);. Show the tree that implements the set. The tree is shown " in a compressed, hanging format. AO(n). The expression (showTreeWith hang wide map) shows & the tree that implements the set. If hang is  True, a hanging5 tree is shown otherwise a rotated tree is shown. If  wide is ", an extra wide version is shown. M Set> putStrLn $ showTreeWith True False $ fromDistinctAscList [1,1,2,3,4,5]  (1*) 4  +--(1*) 2  | +--(2*) 1  | +--(1*) 3  +--(1*) 5  L Set> putStrLn $ showTreeWith True True $ fromDistinctAscList [1,1,2,3,4,5]  (1*) 4  |  +--(1*) 2  | |  | +--(2*) 1  | |  | +--(1*) 3  |  +--(1*) 5  M Set> putStrLn $ showTreeWith False True $ fromDistinctAscList [1,1,2,3,4,5]  +--(1*) 5  |  (1*) 4  |  | +--(1*) 3  | |  +--(1*) 2  |  +--(2*) 1 BO(n)4. Test if the internal multiset structure is valid. OŽ  !"#$%&'()*+Š,-./0123456789:;<=>?‘@AB’“”•–—˜C  !"#$%&'()*+,-./0123456789:;<=>?@ABC  !">?#$%&'(*)+,-./1023456789:;<=@ABMŽ  !"#$%&'()*+Š,-./0123456789:;<=>?‘@AB’“”•–—˜portable provisionallibraries@haskell.org Safe-InferredEC'The number of occurences of an element EA multiset of integers. , The same value can occur multiple times. FO(n+m). See c. GO(1). Is this the empty multiset? HO(n)*. The number of elements in the multiset. IO(1)3. The number of distinct elements in the multiset. J O(min(n,W))". Is the element in the multiset? K O(min(n,W))&. Is the element not in the multiset? L O(min(n,W))8. The number of occurences of an element in a multiset. MO(1). The empty mutli set. NO(1) . Create a singleton mutli set. O O(min(n,W))#. Insert an element in a multiset. P O(min(n,W));. Insert an element in a multiset a given number of times. 9Negative numbers remove occurences of the given element. Q O(min(n,W))+. Delete a single element from a multiset. R O(min(n,W))=. Delete an element from a multiset a given number of times. 6Negative numbers add occurences of the given element. S O(min(n,W))7. Delete all occurences of an element from a multiset. TO(n+m)9. Is this a proper subset? (ie. a subset but not equal). UO(n+m). Is this a subset?  (s1 ` isSubsetOf` s2) tells whether s1 is a subset of s2. ™O(log n) . The minimal key of an IntMap. šO(log n) . The maximal key of an IntMap. VO(log n)%. The minimal element of a multiset. WO(log n)%. The maximal element of a multiset. XO(log n). Delete the minimal element. YO(log n). Delete the maximal element. ZO(log n)0. Delete all occurences of the minimal element. [O(log n)0. Delete all occurences of the maximal element. \O(log n)'. Delete and find the minimal element. 2 deleteFindMin set = (findMin set, deleteMin set) ]O(log n)'. Delete and find the maximal element. 2 deleteFindMax set = (findMax set, deleteMax set) ^O(log n)X. Retrieves the minimal element of the multiset, and the set stripped from that element  fail0s (in the monad) when passed an empty multiset. _O(log n)X. Retrieves the maximal element of the multiset, and the set stripped from that element  fail0s (in the monad) when passed an empty multiset. `#The union of a list of multisets: (` == † a M). aO(n+m)F. The union of two multisets. The union adds the occurences together. &The implementation uses the efficient  hedge-union algorithm. * Hedge-union is more efficient on (bigset a smallset). bO(n+m). The union of two multisets. : The number of occurences of each element in the union is P the maximum of the number of occurences in the arguments (instead of the sum). &The implementation uses the efficient  hedge-union algorithm. * Hedge-union is more efficient on (bigset a smallset). cO(n+m) . Difference of two multisets. & The implementation uses an efficient hedge algorithm comparable with  hedge-union. dO(n+m)%. The intersection of two multisets. prints  (fromList [A] ,fromList [B]). eO(n)2. Filter all elements that satisfy the predicate. fO(n)P. Partition the multiset into two multisets, one with all elements that satisfy 1 the predicate and one with all elements that don't satisfy the predicate.  See also ‚. g O(n*log n).  g f s& is the multiset obtained by applying f to each element of s. hO(n). The h f s == g f s, but works only when f is strictly monotonic.   The precondition is not checked.  Semi-formally, we have: . and [x < y ==> f x < f y | x <- ls, y <- ls] 5 ==> mapMonotonic f s == map f s  where ls = toList s iO(n). Map and collect the ‡ results. jO(n). Map and separate the ˆ and ‰ results. kO(n)F. Apply a function to each element, and take the union of the results lO(n)F. Apply a function to each element, and take the union of the results mO(n)*. The monad join operation for multisets. nO(n)2. The monad bind operation, (>>=), for multisets. oO(t)@. Fold over the elements of a multiset in an unspecified order. ›O(t). Post-order fold. pO(n)>. Fold over the elements of a multiset with their occurences. qO(t). The elements of a multiset. rO(n)R. The distinct elements of a multiset, each element occurs only once in the list. ' distinctElems = map fst . toOccurList sO(t).. Convert the multiset to a list of elements. tO(t)9. Convert the multiset to an ascending list of elements. u O(t*min(n,W))-. Create a multiset from a list of elements. vO(t):. Build a multiset from an ascending list in linear time.  :The precondition (input list is ascending) is not checked. wO(n)O. Build a multiset from an ascending list of distinct elements in linear time.  CThe precondition (input list is strictly ascending) is not checked. xO(n)+. Convert the multiset to a list of element/occurence pairs. yO(n)6. Convert the multiset to an ascending list of element/occurence pairs. z O(n*min(n,W))*. Create a multiset from a list of element/occurence pairs. {O(n)4. Build a multiset from an ascending list of element/ occurence pairs in linear time.  :The precondition (input list is ascending) is not checked. |O(n)5. Build a multiset from an ascending list of elements/7occurence pairs where each elements appears only once.  CThe precondition (input list is strictly ascending) is not checked. }O(1). Convert a multiset to an œ) from elements to number of occurrences. ~O(n) . Convert an œ- from elements to occurrences to a multiset. O(1) . Convert an œ- from elements to occurrences to a multiset.  Assumes that the œ' contains only values larger than one.  3The precondition (all elements > 1) is not checked. €O(n). Convert a multiset to an œ, removing duplicates. O(n) . Convert an œ to a multiset. ‚O(log n). The expression (‚ x set ) is a pair  (set1,set2)  where all elements in set1 are lower than x and all elements in  set2 larger than x. x is not found in neither set1 nor set2. ƒO(log n) . Performs a ‚ but also returns the number of 6 occurences of the pivot element in the original set. „O(n);. Show the tree that implements the set. The tree is shown " in a compressed, hanging format. …O(n). The expression (showTreeWith hang wide map) shows & the tree that implements the set. If hang is  True, a hanging5 tree is shown otherwise a rotated tree is shown. If  wide is ", an extra wide version is shown. M Set> putStrLn $ showTreeWith True False $ fromDistinctAscList [1,1,2,3,4,5]  (1*) 4  +--(1*) 2  | +--(2*) 1  | +--(1*) 3  +--(1*) 5  L Set> putStrLn $ showTreeWith True True $ fromDistinctAscList [1,1,2,3,4,5]  (1*) 4  |  +--(1*) 2  | |  | +--(2*) 1  | |  | +--(1*) 3  |  +--(1*) 5  M Set> putStrLn $ showTreeWith False True $ fromDistinctAscList [1,1,2,3,4,5]  +--(1*) 5  |  (1*) 4  |  | +--(1*) 3  | |  +--(1*) 2  |  +--(2*) 1 PCDEžFGHIJKLMNOPQRSŸTU™šVWXYZ[\]^_`abcdefghijklmno›pqrstuvwxyz{|}~€‚ƒ „…‘’£€₯¦CCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…CEDCFGHIJKLUTMNOPQRSa`bcdef‚ƒghijklnmopVWXYZ[\]_^qrsutvwxyz{|}~€„…NCDEžFGHIJKLMNOPQRSŸTU™šVWXYZ[\]^_`abcdefghijklmno›pqrstuvwxyz{|}~€‚ƒ „…‘’£€₯¦§      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG      !"#$%&'()*+,-./0123456789:;<=>?@ABCDHIJHKLHMNHMOPQRSQTUVWXYZ[\]^_`abcdePQfgYZ[\hijklmnmultiset-0.2.2 Data.MultiSetData.IntMultiSetOccurMultiSet\\nullsize distinctSizemember notMemberoccurempty singletoninsert insertManydelete deleteMany deleteAllisProperSubsetOf isSubsetOffindMinfindMax deleteMin deleteMax deleteMinAll deleteMaxAll deleteFindMin deleteFindMaxminViewmaxViewunionsunionmaxUnion difference intersectionfilter partitionmap mapMonotonicmapMaybe mapEither concatMap unionsMapjoinbindfold foldOccurelems distinctElemstoList toAscListfromList fromAscListfromDistinctAscList toOccurListtoAscOccurList fromOccurListfromAscOccurListfromDistinctAscOccurListtoMapfromMap fromOccurMaptoSetfromSetsplit splitOccurshowTree showTreeWithvalidKey IntMultiSetbaseGHC.Listfoldl Data.MaybeJust Data.EitherLeftRightfoldrcontainers-0.5.0.0 Data.Map.BaseMap Data.Set.BaseSetghc-prim GHC.TypesTrueMSunMSdeleteN foldlStrict$fReadMultiSet$fShowMultiSet $fOrdMultiSet $fEqMultiSet$fDataMultiSet$fFoldableMultiSet$fMonoidMultiSetminKeymaxKeyData.IntMap.BaseIntMap$fReadIntMultiSet$fShowIntMultiSet$fOrdIntMultiSet$fEqIntMultiSet$fDataIntMultiSet$fMonoidIntMultiSet