more-containers: A few more collections

[ data-structures, library, mit ] [ Propose Tags ]

https://github.com/mtth/more-containers


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.1.0, 0.1.2.0, 0.2.0.0, 0.2.0.1, 0.2.1.0, 0.2.1.1, 0.2.1.2, 0.2.2.0
Dependencies base (>=4.11 && <5), containers (>=0.6) [details]
License MIT
Copyright 2017-2019 Matthieu Monsch
Author Matthieu Monsch
Maintainer mtth@apache.org
Category Data Structures
Home page https://github.com/mtth/more-containers
Bug tracker https://github.com/mtth/more-containers/issues
Source repo head: git clone https://github.com/mtth/more-containers
Uploaded by mtth at Sat Jun 29 04:37:51 UTC 2019
Distributions NixOS:0.2.2.0
Downloads 3126 total (278 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-06-29 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for more-containers-0.2.0.0

[back to package description]

More containers Stackage LTS Stackage Nightly Hackage Build Status

Multisets

> m1 = fromList [1, 2, 1] :: Multiset Int
> count 1 m -- 2
> m2 = replicate 3 1 -- fromList [1, 1, 1]
> insert 1 m == m2 <> singleton 2 -- True

Multimaps

This library provides both generic and versions specialized to lists, sets, and sequences.

> m1 = fromList [(1, "ab"), (2, "d")] :: ListMultimap Int Char
> m1 ! 1 -- "ab"
> m1 ! 3 -- ""
> m2 = prepend 2 'c' m1 -- fromList [(1, "ab"), (2, "cd")]
> toList m2 -- [(1, 'a'), (1, 'b'), (2, 'c'), (2, 'd')]