https://github.com/bgamari/monoidal-containers
Maps using values' monoidal structure during merging
https://github.com/bgamari/monoidal-containers
Last synced: 6 months ago
JSON representation
Maps using values' monoidal structure during merging
- Host: GitHub
- URL: https://github.com/bgamari/monoidal-containers
- Owner: bgamari
- License: other
- Created: 2015-01-20T16:57:34.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-04-05T16:47:51.000Z (over 1 year ago)
- Last Synced: 2025-04-12T23:42:04.031Z (over 1 year ago)
- Language: Haskell
- Homepage:
- Size: 184 KB
- Stars: 42
- Watchers: 6
- Forks: 33
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# monoidal-containers
[](https://haskell.org) [](https://hackage.haskell.org/package/monoidal-containers) [](https://matrix.hackage.haskell.org/#/package/monoidal-containers) [](https://github.com/bgamari/monoidal-containers/actions) [](https://github.com/bgamari/monoidal-containers/blob/master/LICENSE)
Often when working with the containers offered by the `containers` and
`unordered-containers` packages one would prefer the monoidal structure
of the values to be used when resolving conflicts between keys when merging
structures. Sadly, these are not the semantics offered by the provided
instances. This package provides `newtypes` with an appropriate set of
instances and utility functions to make them usable.
## Important Note
This library is designed to be a drop-in replacement for `Data.Map` and similar. Absolutely no other semantic changes are introduced in functions like `fromList` or `insert`. They are still left-biased like `Data.Map`'s. The only difference is in instances for `Semigroup`.