Skip to content

Commit 41783ed

Browse files
authored
Remove some long deprecated functions (#1046)
They were marked {-# DEPRECATED #-} for 0.5.8.1 (2016). Later, they were replaced with definitions that produce type errors in 0.6.0.1 (2018).
1 parent 24b0b3a commit 41783ed

File tree

15 files changed

+18
-195
lines changed

15 files changed

+18
-195
lines changed

containers-tests/containers-tests.cabal

-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ library
131131

132132
if impl(ghc)
133133
other-modules:
134-
Data.IntMap.Internal.DeprecatedDebug
135-
Data.Map.Internal.DeprecatedShowTree
136134
Utils.Containers.Internal.TypeError
137135

138136
if impl(ghc >= 8.6)

containers-tests/tests/intmap-properties.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{-# LANGUAGE CPP #-}
22

33
#ifdef STRICT
4-
import Data.IntMap.Strict as Data.IntMap hiding (showTree)
4+
import Data.IntMap.Strict as Data.IntMap
55
import Data.IntMap.Strict.Internal (traverseMaybeWithKey)
66
import Data.IntMap.Merge.Strict
77
#else
8-
import Data.IntMap.Lazy as Data.IntMap hiding (showTree)
8+
import Data.IntMap.Lazy as Data.IntMap
99
import Data.IntMap.Internal (traverseMaybeWithKey)
1010
import Data.IntMap.Merge.Lazy
1111
#endif

containers-tests/tests/map-properties.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{-# LANGUAGE CPP #-}
22

33
#ifdef STRICT
4-
import Data.Map.Strict as Data.Map hiding (showTree, showTreeWith)
4+
import Data.Map.Strict as Data.Map
55
import Data.Map.Merge.Strict
66
#else
7-
import Data.Map.Lazy as Data.Map hiding (showTree, showTreeWith)
7+
import Data.Map.Lazy as Data.Map
88
import Data.Map.Merge.Lazy
99
#endif
1010
import Data.Map.Internal (Map (..), link2, link, bin)

containers/changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
Previously they were lazier and did not force the first value in runs of at
2626
least 2 entries with equal keys. (Soumik Sarkar)
2727

28+
* Various deprecated functions, whose definitions currently cause type errors,
29+
have been removed. (Soumik Sarkar)
30+
2831
### Bug fixes
2932

3033
* Make the package compile with MicroHs. (Lennart Augustsson)

containers/containers.cabal

-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,5 @@ Library
8686
if impl(ghc)
8787
other-modules:
8888
Utils.Containers.Internal.TypeError
89-
Data.Map.Internal.DeprecatedShowTree
90-
Data.IntMap.Internal.DeprecatedDebug
9189

9290
include-dirs: include

containers/src/Data/IntMap.hs

+5-51
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
#if !defined(TESTING) && defined(__GLASGOW_HASKELL__)
33
{-# LANGUAGE Safe #-}
44
#endif
5-
#ifdef __GLASGOW_HASKELL__
6-
{-# LANGUAGE DataKinds #-}
7-
{-# LANGUAGE FlexibleContexts #-}
8-
{-# LANGUAGE MonoLocalBinds #-}
9-
#endif
105

116
#include "containers.h"
127

@@ -19,25 +14,20 @@
1914
-- Maintainer : [email protected]
2015
-- Portability : portable
2116
--
22-
-- An efficient implementation of maps from integer keys to values
23-
-- (dictionaries).
17+
-- The @'IntMap' v@ type represents a finite map (sometimes called a dictionary)
18+
-- from key of type @Int@ to values of type @v@.
2419
--
25-
-- This module re-exports the value lazy "Data.IntMap.Lazy" API, plus
26-
-- several deprecated value strict functions. Please note that these functions
27-
-- have different strictness properties than those in "Data.IntMap.Strict":
28-
-- they only evaluate the result of the combining function. For example, the
29-
-- default value to 'insertWith'' is only evaluated if the combining function
30-
-- is called and uses it.
20+
-- This module re-exports the value lazy "Data.IntMap.Lazy" API.
3121
--
32-
-- These modules are intended to be imported qualified, to avoid name
22+
-- This module is intended to be imported qualified, to avoid name
3323
-- clashes with Prelude functions, e.g.
3424
--
3525
-- > import Data.IntMap (IntMap)
3626
-- > import qualified Data.IntMap as IntMap
3727
--
3828
-- The implementation is based on /big-endian patricia trees/. This data
3929
-- structure performs especially well on binary operations like 'union'
40-
-- and 'intersection'. However, my benchmarks show that it is also
30+
-- and 'intersection'. Additionally, benchmarks show that it is also
4131
-- (much) faster on insertions and deletions when compared to a generic
4232
-- size-balanced map implementation (see "Data.Map").
4333
--
@@ -80,42 +70,6 @@
8070

8171
module Data.IntMap
8272
( module Data.IntMap.Lazy
83-
#ifdef __GLASGOW_HASKELL__
84-
-- For GHC, we disable these, pending removal. For anything else,
85-
-- we just don't define them at all.
86-
, insertWith'
87-
, insertWithKey'
88-
, fold
89-
, foldWithKey
90-
#endif
9173
) where
9274

9375
import Data.IntMap.Lazy
94-
95-
#ifdef __GLASGOW_HASKELL__
96-
import Utils.Containers.Internal.TypeError
97-
98-
-- | This function is being removed and is no longer usable.
99-
-- Use 'Data.IntMap.Strict.insertWith'
100-
insertWith' :: Whoops "Data.IntMap.insertWith' is gone. Use Data.IntMap.Strict.insertWith."
101-
=> (a -> a -> a) -> Key -> a -> IntMap a -> IntMap a
102-
insertWith' _ _ _ _ = undefined
103-
104-
-- | This function is being removed and is no longer usable.
105-
-- Use 'Data.IntMap.Strict.insertWithKey'.
106-
insertWithKey' :: Whoops "Data.IntMap.insertWithKey' is gone. Use Data.IntMap.Strict.insertWithKey."
107-
=> (Key -> a -> a -> a) -> Key -> a -> IntMap a -> IntMap a
108-
insertWithKey' _ _ _ _ = undefined
109-
110-
-- | This function is being removed and is no longer usable.
111-
-- Use 'Data.IntMap.Lazy.foldr'.
112-
fold :: Whoops "Data.IntMap.fold' is gone. Use Data.IntMap.foldr or Prelude.foldr."
113-
=> (a -> b -> b) -> b -> IntMap a -> b
114-
fold _ _ _ = undefined
115-
116-
-- | This function is being removed and is no longer usable.
117-
-- Use 'foldrWithKey'.
118-
foldWithKey :: Whoops "Data.IntMap.foldWithKey is gone. Use foldrWithKey."
119-
=> (Key -> a -> b -> b) -> b -> IntMap a -> b
120-
foldWithKey _ _ _ = undefined
121-
#endif

containers/src/Data/IntMap/Internal/DeprecatedDebug.hs

-17
This file was deleted.

containers/src/Data/IntMap/Lazy.hs

+1-10
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,7 @@ module Data.IntMap.Lazy (
238238
, maxView
239239
, minViewWithKey
240240
, maxViewWithKey
241-
242-
#ifdef __GLASGOW_HASKELL__
243-
-- * Debugging
244-
, showTree
245-
, showTreeWith
246-
#endif
247241
) where
248242

249243
import Data.IntSet.Internal.IntTreeCommons (Key)
250-
import Data.IntMap.Internal as IM hiding (showTree, showTreeWith)
251-
#ifdef __GLASGOW_HASKELL__
252-
import Data.IntMap.Internal.DeprecatedDebug
253-
#endif
244+
import Data.IntMap.Internal as IM

containers/src/Data/IntMap/Strict.hs

-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE BangPatterns #-}
32
#if !defined(TESTING) && defined(__GLASGOW_HASKELL__)
43
{-# LANGUAGE Trustworthy #-}
54
#endif
@@ -257,12 +256,6 @@ module Data.IntMap.Strict (
257256
, maxView
258257
, minViewWithKey
259258
, maxViewWithKey
260-
261-
#ifdef __GLASGOW_HASKELL__
262-
-- * Debugging
263-
, showTree
264-
, showTreeWith
265-
#endif
266259
) where
267260

268261
import Data.IntMap.Strict.Internal

containers/src/Data/IntMap/Strict/Internal.hs

-9
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,6 @@ module Data.IntMap.Strict.Internal (
254254
, maxView
255255
, minViewWithKey
256256
, maxViewWithKey
257-
258-
#ifdef __GLASGOW_HASKELL__
259-
-- * Debugging
260-
, showTree
261-
, showTreeWith
262-
#endif
263257
) where
264258

265259
import Utils.Containers.Internal.Prelude hiding
@@ -351,9 +345,6 @@ import Data.IntMap.Internal
351345
, unions
352346
, withoutKeys
353347
)
354-
#ifdef __GLASGOW_HASKELL__
355-
import Data.IntMap.Internal.DeprecatedDebug (showTree, showTreeWith)
356-
#endif
357348
import qualified Data.IntSet.Internal as IntSet
358349
import Utils.Containers.Internal.BitUtil
359350
import Utils.Containers.Internal.StrictPair

containers/src/Data/Map.hs

+5-55
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
{-# LANGUAGE Safe #-}
44
#endif
55

6-
#ifdef __GLASGOW_HASKELL__
7-
{-# LANGUAGE DataKinds, FlexibleContexts, MonoLocalBinds #-}
8-
#endif
9-
106
#include "containers.h"
117

128
-----------------------------------------------------------------------------
@@ -18,17 +14,13 @@
1814
-- Maintainer : [email protected]
1915
-- Portability : portable
2016
--
21-
-- /Note:/ You should use "Data.Map.Strict" instead of this module if:
22-
--
23-
-- * You will eventually need all the values stored.
17+
-- The @'Map' k v@ type represents a finite map (sometimes called a dictionary)
18+
-- from keys of type @k@ to values of type @v@. A 'Map' is strict in its keys but lazy
19+
-- in its values.
2420
--
25-
-- * The stored values don't represent large virtual data structures
26-
-- to be lazily computed.
21+
-- This module re-exports the value lazy "Data.Map.Lazy" API.
2722
--
28-
-- An efficient implementation of ordered maps from keys to values
29-
-- (dictionaries).
30-
--
31-
-- These modules are intended to be imported qualified, to avoid name
23+
-- This module is intended to be imported qualified, to avoid name
3224
-- clashes with Prelude functions, e.g.
3325
--
3426
-- > import qualified Data.Map as Map
@@ -70,48 +62,6 @@
7062

7163
module Data.Map
7264
( module Data.Map.Lazy
73-
#ifdef __GLASGOW_HASKELL__
74-
, insertWith'
75-
, insertWithKey'
76-
, insertLookupWithKey'
77-
, fold
78-
, foldWithKey
79-
#endif
8065
) where
8166

8267
import Data.Map.Lazy
83-
84-
#ifdef __GLASGOW_HASKELL__
85-
import Utils.Containers.Internal.TypeError
86-
87-
-- | This function is being removed and is no longer usable.
88-
-- Use 'Data.Map.Strict.insertWith'.
89-
insertWith' :: Whoops "Data.Map.insertWith' is gone. Use Data.Map.Strict.insertWith."
90-
=> (a -> a -> a) -> k -> a -> Map k a -> Map k a
91-
insertWith' _ _ _ _ = undefined
92-
93-
-- | This function is being removed and is no longer usable.
94-
-- Use 'Data.Map.Strict.insertWithKey'.
95-
insertWithKey' :: Whoops "Data.Map.insertWithKey' is gone. Use Data.Map.Strict.insertWithKey."
96-
=> (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a
97-
insertWithKey' _ _ _ _ = undefined
98-
99-
-- | This function is being removed and is no longer usable.
100-
-- Use 'Data.Map.Strict.insertLookupWithKey'.
101-
insertLookupWithKey' :: Whoops "Data.Map.insertLookupWithKey' is gone. Use Data.Map.Strict.insertLookupWithKey."
102-
=> (k -> a -> a -> a) -> k -> a -> Map k a
103-
-> (Maybe a, Map k a)
104-
insertLookupWithKey' _ _ _ _ = undefined
105-
106-
-- | This function is being removed and is no longer usable.
107-
-- Use 'Data.Map.Strict.foldr'.
108-
fold :: Whoops "Data.Map.fold is gone. Use foldr."
109-
=> (a -> b -> b) -> b -> Map k a -> b
110-
fold _ _ _ = undefined
111-
112-
-- | This function is being removed and is no longer usable.
113-
-- Use 'foldrWithKey'.
114-
foldWithKey :: Whoops "Data.Map.foldWithKey is gone. Use foldrWithKey."
115-
=> (k -> a -> b -> b) -> b -> Map k a -> b
116-
foldWithKey _ _ _ = undefined
117-
#endif

containers/src/Data/Map/Internal/DeprecatedShowTree.hs

-21
This file was deleted.

containers/src/Data/Map/Lazy.hs

-5
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,9 @@ module Data.Map.Lazy (
279279
, maxViewWithKey
280280

281281
-- * Debugging
282-
#ifdef __GLASGOW_HASKELL__
283-
, showTree
284-
, showTreeWith
285-
#endif
286282
, valid
287283
) where
288284

289285
import Data.Map.Internal
290-
import Data.Map.Internal.DeprecatedShowTree (showTree, showTreeWith)
291286
import Data.Map.Internal.Debug (valid)
292287
import Prelude ()

containers/src/Data/Map/Strict.hs

-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE BangPatterns #-}
32
#if defined(__GLASGOW_HASKELL__)
43
{-# LANGUAGE Safe #-}
54
#endif
@@ -296,10 +295,6 @@ module Data.Map.Strict
296295
, maxViewWithKey
297296

298297
-- * Debugging
299-
#ifdef __GLASGOW_HASKELL__
300-
, showTree
301-
, showTreeWith
302-
#endif
303298
, valid
304299
) where
305300

containers/src/Data/Map/Strict/Internal.hs

-7
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,6 @@ module Data.Map.Strict.Internal
304304
, maxViewWithKey
305305

306306
-- * Debugging
307-
#ifdef __GLASGOW_HASKELL__
308-
, showTree
309-
, showTreeWith
310-
#endif
311307
, valid
312308
) where
313309

@@ -424,9 +420,6 @@ import Data.Map.Internal
424420
, unions
425421
, withoutKeys )
426422

427-
#if defined(__GLASGOW_HASKELL__)
428-
import Data.Map.Internal.DeprecatedShowTree (showTree, showTreeWith)
429-
#endif
430423
import Data.Map.Internal.Debug (valid)
431424

432425
import Control.Applicative (Const (..), liftA3)

0 commit comments

Comments
 (0)