bgamari/monoidal-containers

Maps using values' monoidal structure during merging

Haskell

43

218 commits

updated Jun 20, 2026

See the code

README

monoidal-containers

Haskell Hackage Hackage CI Github CI BSD3 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.

Contributors

bgamari

76 commits

ali-abrar

63 commits

alexfmpe

11 commits

ocharles

10 commits

bgamari/monoidal-containers

Maps using values' monoidal structure during merging

Haskell

43

218 commits

updated Jun 20, 2026

See the code

README

monoidal-containers

Haskell Hackage Hackage CI Github CI BSD3 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.

Contributors

bgamari

76 commits

ali-abrar

63 commits

alexfmpe

11 commits

ocharles

10 commits

Languages

Haskell

99.6%