monoidal-containers

Containers with monoidal accumulation

http://github.com/bgamari/monoidal-containers

Version on this page:0.6.5.0@rev:2
LTS Haskell 23.27:0.6.6.0
Stackage Nightly 2025-07-12:0.6.6.0
Latest on Hackage:0.6.6.0

See all snapshotsmonoidal-containers appears in

BSD-3-Clause licensedbyBen Gamari
Maintained by[email protected]
This version can be pinned in stack with:monoidal-containers-0.6.5.0@sha256:15a08da08022bb30d2ae56040cd75e5c694d4c0826412597b82d21d90564c188,2338

Module documentation for 0.6.5.0

Containers with merging via monoidal accumulation. TheMonoid instancesprovided by thecontainers andunordered-containers packages mergestructures in a left-biased manner instead of using the underlying monoidalstructure of the value.

This package wraps the types provided by these packages, but providesMonoidinstances implemented in terms of the value type'smappend. For instance,theMonoidMap instance looks like,

instance (Ord k, Semigroup a) => Monoid (MonoidalMap k a)

Changes

Monoidal containers

0.6.5.0

0.6.4.0

0.6.3.0

0.6.2.0

0.6.1.0

  • Drop official support for GHC 7.8.4
  • Require containers 0.5.9 or greater.
  • Support lens-5, semialign-1.2, and aeson-2
  • MonoidalMap and MonoidalMap.Strict: Add several functions added to Data.Map since 0.5 up to 0.5.9:take,drop,splitAt,lookupMin,lookupMax,restrictKeys,withoutKeys,fromDescList,fromDescListWith,fromDescListWithKey,fromDistinctDescList,takeWhileAntitone,dropWhileAntitone,spanAntitone, andtraverseMaybeWithKey
  • Add instances ofFilterable andWitherable from thewitherable package
  • AddControl.Lens.Wrapped.Rewrapped instances.

0.6.0.1

  • Support semialign-1.1

0.6

  • Deprecates 0.5.* and reverts behavior of fromList, insert, mapKeys, etc. to match behavior in Data.Map. The only difference in behavior between Data.Map.Monoidal.MonoidalMap and Data.Map.Map is now the semigroup and monoid instances (as was the case in 0.4 and earlier).
  • Fix the argument order of Data.HashMap.Monoidal.insert
  • Remove Data.HashMap.Monoidal.insertOrReplace as it is now identical to Data.HashMap.Monoidal.insert
  • Added Data.HashMap.Monoidal.insertWith and Data.HashMap.Monoidal.fromListWith

0.5.0.1

  • Add a flag,split-these, to select whether to use the new “these”/“semialign” packages or the older combined “these” package.
  • Add default.nix to make it easier to hack on this package in nix

0.5.0.0

  • Added Data.IntMap.Monoidal and Data.IntMap.Monoidal.Strict, corresponding to Data.IntMap and Data.IntMap.Strict
  • MakefromList,insert, andmapKeys fromData.Map.Monoidal andData.Map.Monoidal.Strict requireSemigroup on values to properly capture monoidal behavior instead of reverting to the left-biased semantics ofData.Map.
  • Add Align instances and, for sufficiently recent versions ofthese, Semialign instances
  • Supportthese 0.8.0

0.4.0.0

General changes:

  • Added support forunordered-containers < 0.2.8
  • Added many more functions inData.Map.[Strict.]Monoid

WeakenedMonoid constraints toSemigroup whenever possible as enabled by theSemigroup-Monoidproposal.This includes,

  • theMonoid instance ofMonoidalHashMap andMonoidalMap
  • theIsList instance ofMonoidalHashMap andMonoidalMap
  • themodifyDef andmapKeys functions ofMonoidalHashMap

0.3 and earlier

Pre-history