diff --git a/containers-tests/containers-tests.cabal b/containers-tests/containers-tests.cabal index 98143d888..da7c76a0f 100644 --- a/containers-tests/containers-tests.cabal +++ b/containers-tests/containers-tests.cabal @@ -131,8 +131,6 @@ library if impl(ghc) other-modules: - Data.IntMap.Internal.DeprecatedDebug - Data.Map.Internal.DeprecatedShowTree Utils.Containers.Internal.TypeError if impl(ghc >= 8.6) diff --git a/containers-tests/tests/intmap-properties.hs b/containers-tests/tests/intmap-properties.hs index 6a1abaa00..38f88e451 100644 --- a/containers-tests/tests/intmap-properties.hs +++ b/containers-tests/tests/intmap-properties.hs @@ -1,11 +1,11 @@ {-# LANGUAGE CPP #-} #ifdef STRICT -import Data.IntMap.Strict as Data.IntMap hiding (showTree) +import Data.IntMap.Strict as Data.IntMap import Data.IntMap.Strict.Internal (traverseMaybeWithKey) import Data.IntMap.Merge.Strict #else -import Data.IntMap.Lazy as Data.IntMap hiding (showTree) +import Data.IntMap.Lazy as Data.IntMap import Data.IntMap.Internal (traverseMaybeWithKey) import Data.IntMap.Merge.Lazy #endif diff --git a/containers-tests/tests/map-properties.hs b/containers-tests/tests/map-properties.hs index d054e6c4c..6b7a45ad5 100644 --- a/containers-tests/tests/map-properties.hs +++ b/containers-tests/tests/map-properties.hs @@ -1,10 +1,10 @@ {-# LANGUAGE CPP #-} #ifdef STRICT -import Data.Map.Strict as Data.Map hiding (showTree, showTreeWith) +import Data.Map.Strict as Data.Map import Data.Map.Merge.Strict #else -import Data.Map.Lazy as Data.Map hiding (showTree, showTreeWith) +import Data.Map.Lazy as Data.Map import Data.Map.Merge.Lazy #endif import Data.Map.Internal (Map (..), link2, link, bin) diff --git a/containers/changelog.md b/containers/changelog.md index f944d9440..ca8732364 100644 --- a/containers/changelog.md +++ b/containers/changelog.md @@ -25,6 +25,9 @@ Previously they were lazier and did not force the first value in runs of at least 2 entries with equal keys. (Soumik Sarkar) +* Various deprecated functions, whose definitions currently cause type errors, + have been removed. (Soumik Sarkar) + ### Bug fixes * `Data.Map.Strict.mergeWithKey` now forces the result of the combining function diff --git a/containers/containers.cabal b/containers/containers.cabal index 3ab69d3ac..7424a4a9c 100644 --- a/containers/containers.cabal +++ b/containers/containers.cabal @@ -84,7 +84,5 @@ Library if impl(ghc) other-modules: Utils.Containers.Internal.TypeError - Data.Map.Internal.DeprecatedShowTree - Data.IntMap.Internal.DeprecatedDebug include-dirs: include diff --git a/containers/src/Data/IntMap.hs b/containers/src/Data/IntMap.hs index a0724e097..f772be8bc 100644 --- a/containers/src/Data/IntMap.hs +++ b/containers/src/Data/IntMap.hs @@ -2,11 +2,6 @@ #if !defined(TESTING) && defined(__GLASGOW_HASKELL__) {-# LANGUAGE Safe #-} #endif -#ifdef __GLASGOW_HASKELL__ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE MonoLocalBinds #-} -#endif #include "containers.h" @@ -19,17 +14,12 @@ -- Maintainer : libraries@haskell.org -- Portability : portable -- --- An efficient implementation of maps from integer keys to values --- (dictionaries). +-- The @'IntMap' v@ type represents a finite map (sometimes called a dictionary) +-- from key of type @Int@ to values of type @v@. -- --- This module re-exports the value lazy "Data.IntMap.Lazy" API, plus --- several deprecated value strict functions. Please note that these functions --- have different strictness properties than those in "Data.IntMap.Strict": --- they only evaluate the result of the combining function. For example, the --- default value to 'insertWith'' is only evaluated if the combining function --- is called and uses it. +-- This module re-exports the value lazy "Data.IntMap.Lazy" API. -- --- These modules are intended to be imported qualified, to avoid name +-- This module is intended to be imported qualified, to avoid name -- clashes with Prelude functions, e.g. -- -- > import Data.IntMap (IntMap) @@ -37,7 +27,7 @@ -- -- The implementation is based on /big-endian patricia trees/. This data -- structure performs especially well on binary operations like 'union' --- and 'intersection'. However, my benchmarks show that it is also +-- and 'intersection'. Additionally, benchmarks show that it is also -- (much) faster on insertions and deletions when compared to a generic -- size-balanced map implementation (see "Data.Map"). -- @@ -80,42 +70,6 @@ module Data.IntMap ( module Data.IntMap.Lazy -#ifdef __GLASGOW_HASKELL__ --- For GHC, we disable these, pending removal. For anything else, --- we just don't define them at all. - , insertWith' - , insertWithKey' - , fold - , foldWithKey -#endif ) where import Data.IntMap.Lazy - -#ifdef __GLASGOW_HASKELL__ -import Utils.Containers.Internal.TypeError - --- | This function is being removed and is no longer usable. --- Use 'Data.IntMap.Strict.insertWith' -insertWith' :: Whoops "Data.IntMap.insertWith' is gone. Use Data.IntMap.Strict.insertWith." - => (a -> a -> a) -> Key -> a -> IntMap a -> IntMap a -insertWith' _ _ _ _ = undefined - --- | This function is being removed and is no longer usable. --- Use 'Data.IntMap.Strict.insertWithKey'. -insertWithKey' :: Whoops "Data.IntMap.insertWithKey' is gone. Use Data.IntMap.Strict.insertWithKey." - => (Key -> a -> a -> a) -> Key -> a -> IntMap a -> IntMap a -insertWithKey' _ _ _ _ = undefined - --- | This function is being removed and is no longer usable. --- Use 'Data.IntMap.Lazy.foldr'. -fold :: Whoops "Data.IntMap.fold' is gone. Use Data.IntMap.foldr or Prelude.foldr." - => (a -> b -> b) -> b -> IntMap a -> b -fold _ _ _ = undefined - --- | This function is being removed and is no longer usable. --- Use 'foldrWithKey'. -foldWithKey :: Whoops "Data.IntMap.foldWithKey is gone. Use foldrWithKey." - => (Key -> a -> b -> b) -> b -> IntMap a -> b -foldWithKey _ _ _ = undefined -#endif diff --git a/containers/src/Data/IntMap/Internal/DeprecatedDebug.hs b/containers/src/Data/IntMap/Internal/DeprecatedDebug.hs deleted file mode 100644 index 708a38aa5..000000000 --- a/containers/src/Data/IntMap/Internal/DeprecatedDebug.hs +++ /dev/null @@ -1,17 +0,0 @@ -{-# LANGUAGE CPP, FlexibleContexts, DataKinds, MonoLocalBinds #-} - -module Data.IntMap.Internal.DeprecatedDebug where -import Data.IntMap.Internal (IntMap) - -import Utils.Containers.Internal.TypeError - - --- | 'showTree' has moved to 'Data.IntMap.Internal.Debug.showTree' -showTree :: Whoops "Data.IntMap.showTree has moved to Data.IntMap.Internal.Debug.showTree" - => IntMap a -> String -showTree _ = undefined - --- | 'showTreeWith' has moved to 'Data.IntMap.Internal.Debug.showTreeWith' -showTreeWith :: Whoops "Data.IntMap.showTreeWith has moved to Data.IntMap.Internal.Debug.showTreeWith" - => Bool -> Bool -> IntMap a -> String -showTreeWith _ _ _ = undefined diff --git a/containers/src/Data/IntMap/Lazy.hs b/containers/src/Data/IntMap/Lazy.hs index 0604ae74c..d740cad9a 100644 --- a/containers/src/Data/IntMap/Lazy.hs +++ b/containers/src/Data/IntMap/Lazy.hs @@ -238,16 +238,7 @@ module Data.IntMap.Lazy ( , maxView , minViewWithKey , maxViewWithKey - -#ifdef __GLASGOW_HASKELL__ - -- * Debugging - , showTree - , showTreeWith -#endif ) where import Data.IntSet.Internal.IntTreeCommons (Key) -import Data.IntMap.Internal as IM hiding (showTree, showTreeWith) -#ifdef __GLASGOW_HASKELL__ -import Data.IntMap.Internal.DeprecatedDebug -#endif +import Data.IntMap.Internal as IM diff --git a/containers/src/Data/IntMap/Strict.hs b/containers/src/Data/IntMap/Strict.hs index 8343a5f11..0ed0a659e 100644 --- a/containers/src/Data/IntMap/Strict.hs +++ b/containers/src/Data/IntMap/Strict.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE BangPatterns #-} #if !defined(TESTING) && defined(__GLASGOW_HASKELL__) {-# LANGUAGE Trustworthy #-} #endif @@ -257,12 +256,6 @@ module Data.IntMap.Strict ( , maxView , minViewWithKey , maxViewWithKey - -#ifdef __GLASGOW_HASKELL__ - -- * Debugging - , showTree - , showTreeWith -#endif ) where import Data.IntMap.Strict.Internal diff --git a/containers/src/Data/IntMap/Strict/Internal.hs b/containers/src/Data/IntMap/Strict/Internal.hs index e68b655d5..e4e81a9ac 100644 --- a/containers/src/Data/IntMap/Strict/Internal.hs +++ b/containers/src/Data/IntMap/Strict/Internal.hs @@ -254,12 +254,6 @@ module Data.IntMap.Strict.Internal ( , maxView , minViewWithKey , maxViewWithKey - -#ifdef __GLASGOW_HASKELL__ - -- * Debugging - , showTree - , showTreeWith -#endif ) where import Utils.Containers.Internal.Prelude hiding @@ -351,9 +345,6 @@ import Data.IntMap.Internal , unions , withoutKeys ) -#ifdef __GLASGOW_HASKELL__ -import Data.IntMap.Internal.DeprecatedDebug (showTree, showTreeWith) -#endif import qualified Data.IntSet.Internal as IntSet import Utils.Containers.Internal.BitUtil import Utils.Containers.Internal.StrictPair diff --git a/containers/src/Data/Map.hs b/containers/src/Data/Map.hs index 6c6fe70a5..0eab6c7bc 100644 --- a/containers/src/Data/Map.hs +++ b/containers/src/Data/Map.hs @@ -3,10 +3,6 @@ {-# LANGUAGE Safe #-} #endif -#ifdef __GLASGOW_HASKELL__ -{-# LANGUAGE DataKinds, FlexibleContexts, MonoLocalBinds #-} -#endif - #include "containers.h" ----------------------------------------------------------------------------- @@ -18,17 +14,13 @@ -- Maintainer : libraries@haskell.org -- Portability : portable -- --- /Note:/ You should use "Data.Map.Strict" instead of this module if: --- --- * You will eventually need all the values stored. +-- The @'Map' k v@ type represents a finite map (sometimes called a dictionary) +-- from keys of type @k@ to values of type @v@. A 'Map' is strict in its keys but lazy +-- in its values. -- --- * The stored values don't represent large virtual data structures --- to be lazily computed. +-- This module re-exports the value lazy "Data.Map.Lazy" API. -- --- An efficient implementation of ordered maps from keys to values --- (dictionaries). --- --- These modules are intended to be imported qualified, to avoid name +-- This module is intended to be imported qualified, to avoid name -- clashes with Prelude functions, e.g. -- -- > import qualified Data.Map as Map @@ -70,48 +62,6 @@ module Data.Map ( module Data.Map.Lazy -#ifdef __GLASGOW_HASKELL__ - , insertWith' - , insertWithKey' - , insertLookupWithKey' - , fold - , foldWithKey -#endif ) where import Data.Map.Lazy - -#ifdef __GLASGOW_HASKELL__ -import Utils.Containers.Internal.TypeError - --- | This function is being removed and is no longer usable. --- Use 'Data.Map.Strict.insertWith'. -insertWith' :: Whoops "Data.Map.insertWith' is gone. Use Data.Map.Strict.insertWith." - => (a -> a -> a) -> k -> a -> Map k a -> Map k a -insertWith' _ _ _ _ = undefined - --- | This function is being removed and is no longer usable. --- Use 'Data.Map.Strict.insertWithKey'. -insertWithKey' :: Whoops "Data.Map.insertWithKey' is gone. Use Data.Map.Strict.insertWithKey." - => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a -insertWithKey' _ _ _ _ = undefined - --- | This function is being removed and is no longer usable. --- Use 'Data.Map.Strict.insertLookupWithKey'. -insertLookupWithKey' :: Whoops "Data.Map.insertLookupWithKey' is gone. Use Data.Map.Strict.insertLookupWithKey." - => (k -> a -> a -> a) -> k -> a -> Map k a - -> (Maybe a, Map k a) -insertLookupWithKey' _ _ _ _ = undefined - --- | This function is being removed and is no longer usable. --- Use 'Data.Map.Strict.foldr'. -fold :: Whoops "Data.Map.fold is gone. Use foldr." - => (a -> b -> b) -> b -> Map k a -> b -fold _ _ _ = undefined - --- | This function is being removed and is no longer usable. --- Use 'foldrWithKey'. -foldWithKey :: Whoops "Data.Map.foldWithKey is gone. Use foldrWithKey." - => (k -> a -> b -> b) -> b -> Map k a -> b -foldWithKey _ _ _ = undefined -#endif diff --git a/containers/src/Data/Map/Internal/DeprecatedShowTree.hs b/containers/src/Data/Map/Internal/DeprecatedShowTree.hs deleted file mode 100644 index 0b67acfe6..000000000 --- a/containers/src/Data/Map/Internal/DeprecatedShowTree.hs +++ /dev/null @@ -1,21 +0,0 @@ -{-# LANGUAGE CPP, FlexibleContexts, DataKinds, MonoLocalBinds #-} - -#include "containers.h" - --- | This module simply holds disabled copies of functions from --- Data.Map.Internal.Debug. -module Data.Map.Internal.DeprecatedShowTree where - -import Data.Map.Internal (Map) -import Utils.Containers.Internal.TypeError - --- | This function has moved to 'Data.Map.Internal.Debug.showTree'. -showTree :: Whoops "showTree has moved to Data.Map.Internal.Debug.showTree." - => Map k a -> String -showTree _ = undefined - --- | This function has moved to 'Data.Map.Internal.Debug.showTreeWith'. -showTreeWith :: - Whoops "showTreeWith has moved to Data.Map.Internal.Debug.showTreeWith." - => (k -> a -> String) -> Bool -> Bool -> Map k a -> String -showTreeWith _ _ _ _ = undefined diff --git a/containers/src/Data/Map/Lazy.hs b/containers/src/Data/Map/Lazy.hs index 9eb68462f..2fca4c91d 100644 --- a/containers/src/Data/Map/Lazy.hs +++ b/containers/src/Data/Map/Lazy.hs @@ -279,14 +279,9 @@ module Data.Map.Lazy ( , maxViewWithKey -- * Debugging -#ifdef __GLASGOW_HASKELL__ - , showTree - , showTreeWith -#endif , valid ) where import Data.Map.Internal -import Data.Map.Internal.DeprecatedShowTree (showTree, showTreeWith) import Data.Map.Internal.Debug (valid) import Prelude () diff --git a/containers/src/Data/Map/Strict.hs b/containers/src/Data/Map/Strict.hs index 20a29a475..649898850 100644 --- a/containers/src/Data/Map/Strict.hs +++ b/containers/src/Data/Map/Strict.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE BangPatterns #-} #if defined(__GLASGOW_HASKELL__) {-# LANGUAGE Safe #-} #endif @@ -296,10 +295,6 @@ module Data.Map.Strict , maxViewWithKey -- * Debugging -#ifdef __GLASGOW_HASKELL__ - , showTree - , showTreeWith -#endif , valid ) where diff --git a/containers/src/Data/Map/Strict/Internal.hs b/containers/src/Data/Map/Strict/Internal.hs index c93003e27..0bfada95e 100644 --- a/containers/src/Data/Map/Strict/Internal.hs +++ b/containers/src/Data/Map/Strict/Internal.hs @@ -304,10 +304,6 @@ module Data.Map.Strict.Internal , maxViewWithKey -- * Debugging -#ifdef __GLASGOW_HASKELL__ - , showTree - , showTreeWith -#endif , valid ) where @@ -422,9 +418,6 @@ import Data.Map.Internal , unions , withoutKeys ) -#if defined(__GLASGOW_HASKELL__) -import Data.Map.Internal.DeprecatedShowTree (showTree, showTreeWith) -#endif import Data.Map.Internal.Debug (valid) import Control.Applicative (Const (..), liftA3)