Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 41783ed

Browse files
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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.IntMaphiding (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.IntMaphiding (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

Lines changed: 2 additions & 2 deletions
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.Maphiding (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.Maphiding (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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 5 additions & 51 deletions
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 : libraries@haskell.org
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

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎containers/src/Data/IntMap/Lazy.hs

Lines changed: 1 addition & 10 deletions
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

Lines changed: 0 additions & 7 deletions
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

Lines changed: 0 additions & 9 deletions
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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /