-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename and expose internal modules (#283)
This also removes some "Stability" annotations from internal modules. Context: #211.
- Loading branch information
Showing
12 changed files
with
128 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,22 @@ | |
-- Copyright : 2010-2012 Johan Tibell | ||
-- License : BSD-style | ||
-- Maintainer : [email protected] | ||
-- Stability : provisional | ||
-- Portability : portable | ||
-- | ||
-- = WARNING | ||
-- | ||
-- This module is considered __internal__. | ||
-- | ||
-- The Package Versioning Policy __does not apply__. | ||
-- | ||
-- The contents of this module may change __in any way whatsoever__ | ||
-- and __without any warning__ between minor versions of this package. | ||
-- | ||
-- Authors importing this module are expected to track development | ||
-- closely. | ||
-- | ||
-- = Description | ||
-- | ||
-- A map from /hashable/ keys to values. A map cannot contain | ||
-- duplicate keys; each key can map to at most one value. A 'HashMap' | ||
-- makes no guarantees as to the order of its elements. | ||
|
@@ -23,7 +36,7 @@ | |
-- Many operations have a average-case complexity of /O(log n)/. The | ||
-- implementation uses a large base (i.e. 16) so in practice these | ||
-- operations are constant time. | ||
module Data.HashMap.Strict.Base | ||
module Data.HashMap.Internal.Strict | ||
( | ||
-- * Strictness properties | ||
-- $strictness | ||
|
@@ -107,15 +120,15 @@ import qualified Data.List as L | |
import Data.Hashable (Hashable) | ||
import Prelude hiding (map, lookup) | ||
|
||
import qualified Data.HashMap.Array as A | ||
import qualified Data.HashMap.Base as HM | ||
import Data.HashMap.Base hiding ( | ||
import qualified Data.HashMap.Internal.Array as A | ||
import qualified Data.HashMap.Internal as HM | ||
import Data.HashMap.Internal hiding ( | ||
alter, alterF, adjust, fromList, fromListWith, fromListWithKey, | ||
insert, insertWith, | ||
differenceWith, intersectionWith, intersectionWithKey, map, mapWithKey, | ||
mapMaybe, mapMaybeWithKey, singleton, update, unionWith, unionWithKey, | ||
traverseWithKey) | ||
import Data.HashMap.Unsafe (runST) | ||
import Data.HashMap.Internal.Unsafe (runST) | ||
#if MIN_VERSION_base(4,8,0) | ||
import Data.Functor.Identity | ||
#endif | ||
|
@@ -310,7 +323,7 @@ alterF f = \ !k !m -> | |
{-# INLINABLE [0] alterF #-} | ||
|
||
#if MIN_VERSION_base(4,8,0) | ||
-- See notes in Data.HashMap.Base | ||
-- See notes in Data.HashMap.Internal | ||
test_bottom :: a | ||
test_bottom = error "Data.HashMap.alterF internal error: hit test_bottom" | ||
|
||
|
@@ -322,7 +335,7 @@ impossibleAdjust = error "Data.HashMap.alterF internal error: impossible adjust" | |
|
||
{-# RULES | ||
|
||
-- See detailed notes on alterF rules in Data.HashMap.Base. | ||
-- See detailed notes on alterF rules in Data.HashMap.Internal. | ||
|
||
"alterFWeird" forall f. alterF f = | ||
alterFWeird (f Nothing) (f (Just test_bottom)) f | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,5 +137,5 @@ module Data.HashSet | |
, fromMap | ||
) where | ||
|
||
import Data.HashSet.Base | ||
import Data.HashSet.Internal | ||
import Prelude () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,26 @@ | |
|
||
------------------------------------------------------------------------ | ||
-- | | ||
-- Module : Data.HashSet.Base | ||
-- Module : Data.HashSet.Internal | ||
-- Copyright : 2011 Bryan O'Sullivan | ||
-- License : BSD-style | ||
-- Maintainer : [email protected] | ||
-- Stability : provisional | ||
-- Portability : portable | ||
-- | ||
-- = WARNING | ||
-- | ||
-- This module is considered __internal__. | ||
-- | ||
-- The Package Versioning Policy __does not apply__. | ||
-- | ||
-- The contents of this module may change __in any way whatsoever__ | ||
-- and __without any warning__ between minor versions of this package. | ||
-- | ||
-- Authors importing this module are expected to track development | ||
-- closely. | ||
-- | ||
-- = Description | ||
-- | ||
-- A set of /hashable/ values. A set cannot contain duplicate items. | ||
-- A 'HashSet' makes no guarantees as to the order of its elements. | ||
-- | ||
|
@@ -28,7 +41,7 @@ | |
-- implementation uses a large base (i.e. 16) so in practice these | ||
-- operations are constant time. | ||
|
||
module Data.HashSet.Base | ||
module Data.HashSet.Internal | ||
( | ||
HashSet | ||
|
||
|
@@ -79,7 +92,7 @@ module Data.HashSet.Base | |
|
||
import Control.DeepSeq (NFData(..)) | ||
import Data.Data hiding (Typeable) | ||
import Data.HashMap.Base | ||
import Data.HashMap.Internal | ||
( HashMap, foldMapWithKey, foldlWithKey, foldrWithKey | ||
, equalKeys, equalKeys1) | ||
import Data.Hashable (Hashable(hashWithSalt)) | ||
|
@@ -91,7 +104,7 @@ import Data.Monoid (Monoid(..)) | |
import GHC.Exts (build) | ||
import Prelude hiding (filter, foldr, foldl, map, null) | ||
import qualified Data.Foldable as Foldable | ||
import qualified Data.HashMap.Base as H | ||
import qualified Data.HashMap.Internal as H | ||
import qualified Data.List as List | ||
import Data.Typeable (Typeable) | ||
import Text.Read | ||
|
@@ -257,7 +270,7 @@ fromListConstr :: Constr | |
fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix | ||
|
||
hashSetDataType :: DataType | ||
hashSetDataType = mkDataType "Data.HashSet.Base.HashSet" [fromListConstr] | ||
hashSetDataType = mkDataType "Data.HashSet.Internal.HashSet" [fromListConstr] | ||
|
||
-- | /O(1)/ Construct an empty set. | ||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters