Avoid two-layers of pattern matchin in `union` (#537)
[packages/containers.git] / containers.cabal
index 96c58dc..a4f2815 100644 (file)
@@ -1,5 +1,5 @@
 name: containers
-version: 0.5.8.0
+version: 0.5.11.0
 license: BSD3
 license-file: LICENSE
 maintainer: libraries@haskell.org
@@ -7,10 +7,18 @@ bug-reports: https://github.com/haskell/containers/issues
 synopsis: Assorted concrete container types
 category: Data Structures
 description:
+    .
     This package contains efficient general-purpose implementations
-    of various basic immutable container types.  The declared cost of
-    each operation is either worst-case or amortized, but remains
-    valid even if structures are shared.
+    of various immutable container types including sets, maps, sequences,
+    trees, and graphs.
+    .
+    For a walkthrough of what this package provides with examples of common
+    operations see the [containers
+    introduction](https://haskell-containers.readthedocs.io).
+    .
+    The declared cost of each operation is either worst-case or amortized, but
+    remains valid even if structures are shared.
+
 build-type: Simple
 cabal-version:  >=1.8
 extra-source-files:
@@ -41,29 +49,209 @@ Library
     other-extensions: CPP, BangPatterns
 
     exposed-modules:
+        Data.Containers.ListUtils
         Data.IntMap
         Data.IntMap.Lazy
         Data.IntMap.Strict
+        Data.IntMap.Internal
+        Data.IntMap.Internal.Debug
+        Data.IntMap.Merge.Lazy
+        Data.IntMap.Merge.Strict
+        Data.IntSet.Internal
         Data.IntSet
         Data.Map
         Data.Map.Lazy
+        Data.Map.Lazy.Merge
+        Data.Map.Merge.Lazy
+        Data.Map.Strict.Internal
         Data.Map.Strict
+        Data.Map.Strict.Merge
+        Data.Map.Merge.Strict
+        Data.Map.Internal
+        Data.Map.Internal.Debug
+        Data.Set.Internal
         Data.Set
         Data.Graph
         Data.Sequence
+        Data.Sequence.Internal
+        Data.Sequence.Internal.Sorting
         Data.Tree
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.BitQueue
+        Utils.Containers.Internal.StrictPair
+
     other-modules:
-        Data.IntMap.Base
-        Data.IntSet.Base
-        Data.Map.Base
-        Data.Set.Base
-        Data.Utils.BitQueue
-        Data.Utils.BitUtil
-        Data.Utils.StrictFold
-        Data.Utils.StrictPair
+        Utils.Containers.Internal.State
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictMaybe
+        Utils.Containers.Internal.PtrEquality
+        Utils.Containers.Internal.Coercions
+        Data.Map.Internal.DeprecatedShowTree
+        Data.IntMap.Internal.DeprecatedDebug
 
     include-dirs: include
 
+-----------------------------
+-- B E N C H M A R K I N G --
+-----------------------------
+
+benchmark intmap-benchmarks
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks
+  main-is: IntMap.hs
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3,
+    deepseq >= 1.1.0.0 && < 1.5
+
+benchmark intset-benchmarks
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks
+  main-is: IntSet.hs
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3,
+    deepseq >= 1.1.0.0 && < 1.5
+
+benchmark map-benchmarks
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks
+  main-is: Map.hs
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3,
+    deepseq >= 1.1.0.0 && < 1.5,
+    transformers
+
+benchmark sequence-benchmarks
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks
+  main-is: Sequence.hs
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3,
+    deepseq >= 1.1.0.0 && < 1.5,
+    random < 1.2,
+    transformers
+
+benchmark set-benchmarks
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks
+  main-is: Set.hs
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3,
+    deepseq >= 1.1.0.0 && < 1.5
+
+benchmark set-operations-intmap
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks/SetOperations
+  main-is: SetOperations-IntMap.hs
+  other-modules: SetOperations
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3
+
+benchmark set-operations-intset
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks/SetOperations
+  main-is: SetOperations-IntSet.hs
+  other-modules: SetOperations
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3
+
+benchmark set-operations-map
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks/SetOperations
+  main-is: SetOperations-Map.hs
+  other-modules: SetOperations
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3
+
+benchmark set-operations-set
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks/SetOperations
+  main-is: SetOperations-Set.hs
+  other-modules: SetOperations
+  ghc-options: -O2
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3
+
+benchmark lookupge-intmap
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks/LookupGE, .
+  main-is: IntMap.hs
+  other-modules:
+      Data.IntMap
+      Data.IntMap.Internal.DeprecatedDebug
+      Data.IntMap.Lazy
+      Data.IntMap.Strict
+      Data.IntSet.Internal
+      LookupGE_IntMap
+      Utils.Containers.Internal.BitUtil
+      Utils.Containers.Internal.StrictFold
+      Utils.Containers.Internal.StrictPair
+  ghc-options: -O2
+  cpp-options: -DTESTING
+  other-modules:
+    Data.IntMap.Internal
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3,
+    deepseq >= 1.1.0.0 && < 1.5,
+    ghc-prim
+
+benchmark lookupge-map
+  type: exitcode-stdio-1.0
+  hs-source-dirs: benchmarks/LookupGE, .
+  main-is: Map.hs
+  other-modules:
+      Data.Map
+      Data.Map.Internal.Debug
+      Data.Map.Internal.DeprecatedShowTree
+      Data.Map.Lazy
+      Data.Map.Strict
+      Data.Map.Strict.Internal
+      Data.Set.Internal
+      LookupGE_Map
+      Utils.Containers.Internal.BitQueue
+      Utils.Containers.Internal.BitUtil
+      Utils.Containers.Internal.PtrEquality
+      Utils.Containers.Internal.StrictFold
+      Utils.Containers.Internal.StrictMaybe
+      Utils.Containers.Internal.StrictPair
+  ghc-options: -O2
+  cpp-options: -DTESTING
+  other-modules:
+    Data.Map.Internal
+  build-depends:
+    base >= 4.2 && < 5,
+    containers,
+    criterion >= 0.4.0 && < 1.3,
+    deepseq >= 1.1.0.0 && < 1.5,
+    ghc-prim
+
 -------------------
 -- T E S T I N G --
 -------------------
@@ -74,6 +262,20 @@ Library
 Test-suite map-lazy-properties
     hs-source-dirs: tests, .
     main-is: map-properties.hs
+    other-modules:
+        Data.Map.Internal
+        Data.Map.Internal.Debug
+        Data.Map.Internal.DeprecatedShowTree
+        Data.Map.Lazy
+        Data.Map.Merge.Lazy
+        Data.Set
+        Data.Set.Internal
+        Utils.Containers.Internal.BitQueue
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.PtrEquality
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictMaybe
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING
 
@@ -84,17 +286,30 @@ Test-suite map-lazy-properties
 
     build-depends:
         HUnit,
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-hunit,
-        test-framework-quickcheck2
-    if impl (ghc < 7.10)
-      -- only needed for base < 4.8 to get Identity
-      build-depends: transformers
+        test-framework-quickcheck2,
+        transformers
 
 Test-suite map-strict-properties
     hs-source-dirs: tests, .
     main-is: map-properties.hs
+    other-modules:
+        Data.Map.Internal
+        Data.Map.Internal.Debug
+        Data.Map.Internal.DeprecatedShowTree
+        Data.Map.Merge.Strict
+        Data.Map.Strict
+        Data.Map.Strict.Internal
+        Data.Set
+        Data.Set.Internal
+        Utils.Containers.Internal.BitQueue
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.PtrEquality
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictMaybe
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING -DSTRICT
 
@@ -104,19 +319,19 @@ Test-suite map-strict-properties
     include-dirs: include
 
     build-depends:
-        -- only needed for base < 4.8 to get Identity
         HUnit,
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-hunit,
-        test-framework-quickcheck2
-    if impl (ghc < 7.10)
-      -- only needed for base < 4.8 to get Identity
-      build-depends: transformers
+        test-framework-quickcheck2,
+        transformers
 
 Test-suite bitqueue-properties
     hs-source-dirs: tests, .
     main-is: bitqueue-properties.hs
+    other-modules:
+        Utils.Containers.Internal.BitQueue
+        Utils.Containers.Internal.BitUtil
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING
 
@@ -126,13 +341,22 @@ Test-suite bitqueue-properties
     include-dirs: include
 
     build-depends:
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-quickcheck2
 
 Test-suite set-properties
     hs-source-dirs: tests, .
     main-is: set-properties.hs
+    other-modules:
+        Data.IntSet
+        Data.IntSet.Internal
+        Data.Set
+        Data.Set.Internal
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.PtrEquality
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING
 
@@ -143,14 +367,26 @@ Test-suite set-properties
 
     build-depends:
         HUnit,
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-hunit,
-        test-framework-quickcheck2
+        test-framework-quickcheck2,
+        transformers
 
 Test-suite intmap-lazy-properties
     hs-source-dirs: tests, .
     main-is: intmap-properties.hs
+    other-modules:
+        Data.IntMap.Internal
+        Data.IntMap.Internal.Debug
+        Data.IntMap.Internal.DeprecatedDebug
+        Data.IntMap.Lazy
+        Data.IntSet
+        Data.IntSet.Internal
+        IntMapValidity
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING
 
@@ -161,7 +397,7 @@ Test-suite intmap-lazy-properties
 
     build-depends:
         HUnit,
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-hunit,
         test-framework-quickcheck2
@@ -169,6 +405,17 @@ Test-suite intmap-lazy-properties
 Test-suite intmap-strict-properties
     hs-source-dirs: tests, .
     main-is: intmap-properties.hs
+    other-modules:
+        Data.IntMap.Internal
+        Data.IntMap.Internal.Debug
+        Data.IntMap.Internal.DeprecatedDebug
+        Data.IntMap.Strict
+        Data.IntSet
+        Data.IntSet.Internal
+        IntMapValidity
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING -DSTRICT
 
@@ -179,7 +426,7 @@ Test-suite intmap-strict-properties
 
     build-depends:
         HUnit,
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-hunit,
         test-framework-quickcheck2
@@ -187,6 +434,16 @@ Test-suite intmap-strict-properties
 Test-suite intset-properties
     hs-source-dirs: tests, .
     main-is: intset-properties.hs
+    other-modules:
+        Data.IntSet
+        Data.IntSet.Internal
+        Data.Set
+        Data.Set.Internal
+        IntSetValidity
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.PtrEquality
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING
 
@@ -197,7 +454,7 @@ Test-suite intset-properties
 
     build-depends:
         HUnit,
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-hunit,
         test-framework-quickcheck2
@@ -205,6 +462,27 @@ Test-suite intset-properties
 Test-suite deprecated-properties
     hs-source-dirs: tests, .
     main-is: deprecated-properties.hs
+    other-modules:
+        Data.IntMap
+        Data.IntMap.Internal
+        Data.IntMap.Internal.DeprecatedDebug
+        Data.IntMap.Lazy
+        Data.IntMap.Strict
+        Data.IntSet.Internal
+        Data.Map
+        Data.Map.Internal
+        Data.Map.Internal.Debug
+        Data.Map.Internal.DeprecatedShowTree
+        Data.Map.Lazy
+        Data.Map.Strict
+        Data.Map.Strict.Internal
+        Data.Set.Internal
+        Utils.Containers.Internal.BitQueue
+        Utils.Containers.Internal.BitUtil
+        Utils.Containers.Internal.PtrEquality
+        Utils.Containers.Internal.StrictFold
+        Utils.Containers.Internal.StrictMaybe
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING
 
@@ -214,13 +492,17 @@ Test-suite deprecated-properties
     include-dirs: include
 
     build-depends:
-        QuickCheck,
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-quickcheck2
 
 Test-suite seq-properties
     hs-source-dirs: tests, .
     main-is: seq-properties.hs
+    other-modules:
+        Data.Sequence
+        Data.Sequence.Internal
+        Utils.Containers.Internal.StrictPair
     type: exitcode-stdio-1.0
     cpp-options: -DTESTING
 
@@ -230,7 +512,26 @@ Test-suite seq-properties
     include-dirs: include
 
     build-depends:
-        QuickCheck,
+        QuickCheck >= 2.7.1,
+        test-framework,
+        test-framework-quickcheck2,
+        transformers
+
+Test-suite tree-properties
+    hs-source-dirs: tests, .
+    main-is: tree-properties.hs
+    other-modules:
+        Data.Tree
+    type: exitcode-stdio-1.0
+    cpp-options: -DTESTING
+
+    build-depends: base >= 4.3 && < 5, array, deepseq >= 1.2 && < 1.5, ghc-prim
+    ghc-options: -O2
+    other-extensions: CPP, BangPatterns
+    include-dirs: include
+
+    build-depends:
+        QuickCheck >= 2.7.1,
         test-framework,
         test-framework-quickcheck2,
         transformers
@@ -238,6 +539,19 @@ Test-suite seq-properties
 test-suite map-strictness-properties
   hs-source-dirs: tests, .
   main-is: map-strictness.hs
+  other-modules:
+      Data.Map.Internal
+      Data.Map.Internal.Debug
+      Data.Map.Internal.DeprecatedShowTree
+      Data.Map.Strict
+      Data.Map.Strict.Internal
+      Data.Set.Internal
+      Utils.Containers.Internal.BitQueue
+      Utils.Containers.Internal.BitUtil
+      Utils.Containers.Internal.PtrEquality
+      Utils.Containers.Internal.StrictFold
+      Utils.Containers.Internal.StrictMaybe
+      Utils.Containers.Internal.StrictPair
   type: exitcode-stdio-1.0
 
   build-depends:
@@ -245,7 +559,7 @@ test-suite map-strictness-properties
     base >= 4.3 && < 5,
     ChasingBottoms,
     deepseq >= 1.2 && < 1.5,
-    QuickCheck >= 2.4.0.1,
+    QuickCheck >= 2.7.1,
     ghc-prim,
     test-framework >= 0.3.3,
     test-framework-quickcheck2 >= 0.2.9
@@ -257,6 +571,14 @@ test-suite map-strictness-properties
 test-suite intmap-strictness-properties
   hs-source-dirs: tests, .
   main-is: intmap-strictness.hs
+  other-modules:
+      Data.IntMap.Internal
+      Data.IntMap.Internal.DeprecatedDebug
+      Data.IntMap.Strict
+      Data.IntSet.Internal
+      Utils.Containers.Internal.BitUtil
+      Utils.Containers.Internal.StrictFold
+      Utils.Containers.Internal.StrictPair
   type: exitcode-stdio-1.0
   other-extensions: CPP, BangPatterns
 
@@ -265,7 +587,7 @@ test-suite intmap-strictness-properties
     base >= 4.3 && < 5,
     ChasingBottoms,
     deepseq >= 1.2 && < 1.5,
-    QuickCheck >= 2.4.0.1,
+    QuickCheck >= 2.7.1,
     ghc-prim,
     test-framework >= 0.3.3,
     test-framework-quickcheck2 >= 0.2.9
@@ -276,6 +598,12 @@ test-suite intmap-strictness-properties
 test-suite intset-strictness-properties
   hs-source-dirs: tests, .
   main-is: intset-strictness.hs
+  other-modules:
+      Data.IntSet
+      Data.IntSet.Internal
+      Utils.Containers.Internal.BitUtil
+      Utils.Containers.Internal.StrictFold
+      Utils.Containers.Internal.StrictPair
   type: exitcode-stdio-1.0
   other-extensions: CPP, BangPatterns
 
@@ -284,7 +612,26 @@ test-suite intset-strictness-properties
     base >= 4.3 && < 5,
     ChasingBottoms,
     deepseq >= 1.2 && < 1.5,
-    QuickCheck >= 2.4.0.1,
+    QuickCheck >= 2.7.1,
+    ghc-prim,
+    test-framework >= 0.3.3,
+    test-framework-quickcheck2 >= 0.2.9
+
+  ghc-options: -Wall
+  include-dirs: include
+
+test-suite listutils-properties
+  hs-source-dirs: tests, .
+  main-is: listutils-properties.hs
+  other-modules:
+      Data.Containers.ListUtils
+  type: exitcode-stdio-1.0
+
+  build-depends:
+    base >= 4.3 && < 5,
+    ChasingBottoms,
+    deepseq >= 1.2 && < 1.5,
+    QuickCheck >= 2.7.1,
     ghc-prim,
     test-framework >= 0.3.3,
     test-framework-quickcheck2 >= 0.2.9