containers
containers copied to clipboard
Assorted concrete container types
Many modules use GHC special features when compiled with GHC. Our tests don't currently verify that things will work under other hypothetical compilers. I think we can approximate this by...
This is related to some of what I brought up in https://github.com/haskell/containers/issues/338. I was just working with Data.Set and wanted to call unions on some foldable collection of Sets. I...
Set.fromAscList and Set.fromDescList keep the first of duplicates, inconsistent with other functions
``` λ> import qualified Data.Set as S λ> import qualified Data.Map as M λ> import Data.Semigroup (Arg(..)) λ> M.fromList [(Arg 1 2, 2), (Arg 1 3, 3)] fromList [(Arg 1...
The following operations are implemented by converting to lists and comparing. - [x] Set `==` (improved in #1017) - [x] Set `compare` (same as above) - [x] Map `==` (same...
https://github.com/haskell/containers/blob/734785d2d3ee862726c6c5bb30e6484fff370e50/containers/src/Data/Map/Internal.hs#L3208-L3209 https://github.com/haskell/containers/blob/734785d2d3ee862726c6c5bb30e6484fff370e50/containers/src/Data/Map/Internal.hs#L3227-L3228 https://github.com/haskell/containers/blob/734785d2d3ee862726c6c5bb30e6484fff370e50/containers/src/Data/Map/Strict/Internal.hs#L1454-L1455 https://github.com/haskell/containers/blob/734785d2d3ee862726c6c5bb30e6484fff370e50/containers/src/Data/IntMap/Internal.hs#L2578-L2579 https://github.com/haskell/containers/blob/734785d2d3ee862726c6c5bb30e6484fff370e50/containers/src/Data/IntMap/Internal.hs#L2593-L2595 https://github.com/haskell/containers/blob/734785d2d3ee862726c6c5bb30e6484fff370e50/containers/src/Data/IntMap/Strict/Internal.hs#L983-L984 It would be more efficient to skip the intermediate list and `foldl'` over the map accumulating into another map. An exception here is `Map.mapKeys`,...
* [ ] Check if `Int``Word` can be avoided (from https://github.com/haskell/containers/pull/995#discussion_r1542147809) * [x] Improve some stuff such as `bitcount` and delete obsolete comments (from https://github.com/haskell/containers/pull/998#discussion_r1554569460)
The API currently exposes a few functions that break the abstraction barrier and sometimes allow the construction of invalid structures. We should collect those in separate modules, with the hope...
Strictness tests need to be in good shape to avoid bugs like #996
I checked the source code and did not see these rules defined, but I imagine they should be beneficial for performance. Below are the rewrite rules I mean: ```haskell {-#...
I often use `Map` to group list by a key. The result is of type `Map k [a]`. There is at the moment no easy way to build such Map...