more-containers: A few more collections

[ data-structures, library, mit ] [ Propose Tags ]
Versions [RSS] 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, 0.2.2.2
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 2019-06-29T04:37:51Z
Distributions LTSHaskell:0.2.2.2, NixOS:0.2.2.2, Stackage:0.2.2.2
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 7095 total (52 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-06-29 [all 1 reports]

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')]