Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Multi set backed by Map
.
Synopsis
- type MultiSet2 k = (Int, Map k Int)
- emptyMS2 :: MultiSet2 k
- singletonMS2 :: k -> MultiSet2 k
- fromListMS2 :: Ord k => [k] -> MultiSet2 k
- incMS2 :: Ord k => k -> MultiSet2 k -> MultiSet2 k
- decMS2 :: Ord k => k -> MultiSet2 k -> MultiSet2 k
- addMS2 :: Ord k => k -> Int -> MultiSet2 k -> MultiSet2 k
- subMS2 :: Ord k => k -> Int -> MultiSet2 k -> MultiSet2 k
- memberMS2 :: Ord k => k -> MultiSet2 k -> Bool
- notMemberMS2 :: Ord k => k -> MultiSet2 k -> Bool
- decFindMinMS2 :: Ord k => MultiSet2 k -> (k, MultiSet2 k)
- decFindMaxMS2 :: Ord k => MultiSet2 k -> (k, MultiSet2 k)
- lookupMS2 :: Ord k => k -> MultiSet2 k -> Maybe Int
- getMS2 :: (HasCallStack, Ord k, Show k) => k -> MultiSet2 k -> Int
- innerMS2 :: MultiSet2 k -> Map k Int
Documentation
singletonMS2 :: k -> MultiSet2 k #
\(O(1)\)
fromListMS2 :: Ord k => [k] -> MultiSet2 k #
\(O(N W)\)
notMemberMS2 :: Ord k => k -> MultiSet2 k -> Bool #
\(O(W)\)
decFindMinMS2 :: Ord k => MultiSet2 k -> (k, MultiSet2 k) #
\(O(W)\)
decFindMaxMS2 :: Ord k => MultiSet2 k -> (k, MultiSet2 k) #
\(O(W)\)