Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused imports, dead code, and unused deps #427

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Data/Primitive/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ import qualified GHC.ST as GHCST
import qualified Data.Foldable as F
import Data.Semigroup
import Data.Functor.Identity
#if !MIN_VERSION_base(4,10,0)
import GHC.Base (runRW#)
#endif

import Text.Read (Read (..), parens, prec)
import Text.ParserCombinators.ReadPrec (ReadPrec)
Expand Down Expand Up @@ -799,14 +796,7 @@ instance Read a => Read (Array a) where

-- | @since 0.6.4.0
instance Read1 Array where
#if MIN_VERSION_base(4,10,0)
liftReadPrec = arrayLiftReadPrec
#else
-- This is just the default implementation of liftReadsPrec, but
-- it is not present in older versions of base.
liftReadsPrec rp rl = RdPrc.readPrec_to_S $
arrayLiftReadPrec (RdPrc.readS_to_Prec rp) (RdPrc.readS_to_Prec (const rl))
#endif

-- Note [Forgiving Array Read Instance]
-- We're really forgiving here. We accept
Expand Down
6 changes: 0 additions & 6 deletions Data/Primitive/ByteArray.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ import Control.Monad.ST
import Data.Primitive.Types
import Data.Proxy

#if MIN_VERSION_base(4,10,0)
import qualified GHC.ST as GHCST
#endif

import Data.Word ( Word8 )
#if __GLASGOW_HASKELL__ >= 802
Expand Down Expand Up @@ -640,7 +638,6 @@ cloneMutableByteArray src off n = do
runByteArray
:: (forall s. ST s (MutableByteArray s))
-> ByteArray
#if MIN_VERSION_base(4,10,0) /* In new GHCs, runRW# is available. */
runByteArray m = ByteArray (runByteArray# m)

runByteArray#
Expand All @@ -652,9 +649,6 @@ runByteArray# m = case runRW# $ \s ->

unST :: ST s a -> State# s -> (# State# s, a #)
unST (GHCST.ST f) = f
#else /* In older GHCs, runRW# is not available. */
runByteArray m = runST $ m >>= unsafeFreezeByteArray
#endif

-- Create an uninitialized array of the given size in bytes, apply the function
-- to it, and freeze the result.
Expand Down
6 changes: 0 additions & 6 deletions Data/Primitive/PrimArray.hs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ import Control.Monad.ST
import qualified Data.List as L
import qualified Data.Primitive.ByteArray as PB
import qualified Data.Primitive.Types as PT
#if MIN_VERSION_base(4,10,0)
import qualified GHC.ST as GHCST
#endif
import Language.Haskell.TH.Syntax (Lift (..))

import Data.Semigroup
Expand Down Expand Up @@ -1144,7 +1142,6 @@ cloneMutablePrimArray src off n = do
runPrimArray
:: (forall s. ST s (MutablePrimArray s a))
-> PrimArray a
#if MIN_VERSION_base(4,10,0) /* In new GHCs, runRW# is available. */
runPrimArray m = PrimArray (runPrimArray# m)

runPrimArray#
Expand All @@ -1156,9 +1153,6 @@ runPrimArray# m = case runRW# $ \s ->

unST :: ST s a -> State# s -> (# State# s, a #)
unST (GHCST.ST f) = f
#else /* In older GHCs, runRW# is not available. */
runPrimArray m = runST $ m >>= unsafeFreezePrimArray
#endif

-- | Create an uninitialized array of the given length, apply the function to
-- it, and freeze the result.
Expand Down
10 changes: 0 additions & 10 deletions Data/Primitive/SmallArray.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ import Data.Semigroup
import Text.ParserCombinators.ReadP
import Text.ParserCombinators.ReadPrec (ReadPrec)
import qualified Text.ParserCombinators.ReadPrec as RdPrc
#if !MIN_VERSION_base(4,10,0)
import GHC.Base (runRW#)
#endif

import Data.Functor.Classes (Eq1(..), Ord1(..), Show1(..), Read1(..))
import Language.Haskell.TH.Syntax (Lift(..))
Expand Down Expand Up @@ -892,14 +889,7 @@ instance Read a => Read (SmallArray a) where

-- | @since 0.6.4.0
instance Read1 SmallArray where
#if MIN_VERSION_base(4,10,0)
liftReadPrec = smallArrayLiftReadPrec
#else
-- This is just the default implementation of liftReadsPrec, but
-- it is not present in older versions of base.
liftReadsPrec rp rl = RdPrc.readPrec_to_S $
smallArrayLiftReadPrec (RdPrc.readS_to_Prec rp) (RdPrc.readS_to_Prec (const rl))
#endif

smallArrayDataType :: DataType
smallArrayDataType =
Expand Down
2 changes: 0 additions & 2 deletions Data/Primitive/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ deriving instance Prim CWchar
deriving instance Prim CSigAtomic
deriving instance Prim CLLong
deriving instance Prim CULLong
#if MIN_VERSION_base(4,10,0)
deriving instance Prim CBool
#endif
deriving instance Prim CIntPtr
deriving instance Prim CUIntPtr
deriving instance Prim CIntMax
Expand Down
1 change: 0 additions & 1 deletion primitive.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ test-suite test-qc
type: exitcode-stdio-1.0
build-depends: base
, base-orphans
, ghc-prim
, primitive
, quickcheck-classes-base >= 0.6 && <0.7
, QuickCheck >= 2.13 && < 2.16
Expand Down
1 change: 0 additions & 1 deletion test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE TypeInType #-}

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.10)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.10)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.10)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.10)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.8)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.8)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.8)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.8)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.6)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.6)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.6)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.6)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (windows-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (windows-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (windows-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (windows-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (macOS-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (macOS-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (macOS-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead

Check warning on line 17 in test/Main.hs

View workflow job for this annotation

GitHub Actions / build (macOS-latest, latest)

-XTypeInType is deprecated: use -XDataKinds and -XPolyKinds instead
#endif

import Control.Monad
Expand All @@ -32,7 +32,6 @@

import Data.Functor.Identity (Identity(..))
import qualified Data.Monoid as Monoid
import Data.Ord (Down(..))
import Data.Semigroup (stimes, stimesMonoid)
import qualified Data.Semigroup as Semigroup
#if !(MIN_VERSION_base(4,11,0))
Expand Down
Loading