Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- type Counter k v = Map k v
- empty :: Counter k v
- singleton :: Num v => k -> Counter k v
- updateWith :: (Ord k, Num v) => k -> v -> Counter k v -> Counter k v
- update :: (Ord k, Num v) => k -> Counter k v -> Counter k v
- count :: (Ord k, Num v) => [k] -> Counter k v
- union :: (Ord k, Num v) => Counter k v -> Counter k v -> Counter k v
Documentation
Initialize a counter with a single instance of a key.
:: (Ord k, Num v) | |
=> k | Key to be inserted. |
-> v | Specified frequency count. |
-> Counter k v | Old counter. |
-> Counter k v | New counter. |
Increment the frequency count of a key with a specified value.
Increment the frequency count of a key by 1.
Convert a list of items into a counter.