Commit e14da30b authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Add Data.Word/Int to Compat.Prelude

For one this compensates for `Word` being exported from `Prelude` only with
base >= 4.8, and moreover this brings the well-known {Int,Word}{8,16,32,64}
names into scope by default when using the Compat.Prelude.
parent b0e958a3
......@@ -82,6 +82,11 @@ module Distribution.Compat.Prelude (
chr, ord,
toLower, toUpper,
-- * Data.Word & Data.Int
Word,
Word8, Word16, Word32, Word64,
Int8, Int16, Int32, Int64,
-- * Text.PrettyPrint
(<<>>),
) where
......@@ -90,6 +95,7 @@ module Distribution.Compat.Prelude (
import Prelude as BasePrelude hiding
( IO, mapM, mapM_, sequence, null, length, foldr
#if MINVER_base_48
, Word
-- We hide them, as we import only some members
, Traversable, traverse, sequenceA
, Foldable, foldMap
......@@ -125,6 +131,8 @@ import Data.List (intercalate, intersperse, isPrefixOf,
isSuffixOf, nub, nubBy, sort, sortBy,
unfoldr)
import Data.Maybe
import Data.Int
import Data.Word
import qualified Text.PrettyPrint as Disp
......
......@@ -14,8 +14,6 @@ module Distribution.Compat.Time
import Prelude ()
import Distribution.Compat.Prelude
import Data.Int ( Int64 )
import Data.Word ( Word64 )
import System.Directory ( getModificationTime )
import Distribution.Simple.Utils ( withTempDirectory )
......@@ -42,7 +40,6 @@ import Data.Bits (finiteBitSize)
import Data.Bits (bitSize)
#endif
import Data.Int ( Int32 )
import Foreign ( allocaBytes, peekByteOff )
import System.IO.Error ( mkIOError, doesNotExistErrorType )
import System.Win32.Types ( BOOL, DWORD, LPCTSTR, LPVOID, withTString )
......
......@@ -83,7 +83,6 @@ import Prelude ()
import Distribution.Compat.Prelude
import qualified Data.Version as Base
import Data.Bits (shiftL, shiftR, (.|.), (.&.))
import Data.Word (Word64)
import Distribution.Text
import qualified Distribution.Compat.ReadP as Parse
......
......@@ -79,7 +79,6 @@ import Distribution.Solver.Types.PackageIndex (PackageIndex)
import qualified Distribution.Solver.Types.PackageIndex as PackageIndex
import Distribution.Solver.Types.SourcePackage
import Data.Word
import qualified Data.Map as Map
import Control.DeepSeq
import Control.Monad
......
......@@ -119,7 +119,6 @@ import Data.IORef ( newIORef, writeIORef, readIORef
import Data.List ( delete
, groupBy )
import Data.Maybe ( fromJust )
import Data.Word ( Word32 )
import Numeric ( showHex )
import System.Directory ( canonicalizePath
, createDirectory
......
......@@ -33,8 +33,6 @@ import Data.Bits
import System.FilePath
import Data.List
( groupBy )
import Data.Word
( Word8, Word32)
import Foreign.C.Types ( CInt(..) )
import qualified Control.Exception as Exception
( finally, bracket )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment