Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A Semigroup
-based counter type.
Documentation
type Counter key = AppendMap key (Sum Int) Source #
A Semigroup
-based counter type.
let counts = mkCounter 1 <> mkCounter 2 <> mkCounter 1 :: Counter Int getCounts counts === Map.fromList [(1, 2), (2, 1)]