Skip to content

Commit c4b5c0d

Browse files
authored
Merge pull request #107 from meooow25/drop-array
Drop the dependency on array
2 parents c104438 + c2432c2 commit c4b5c0d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Control/DeepSeq.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{-# LANGUAGE MultiParamTypeClasses #-}
77
{-# LANGUAGE PolyKinds #-}
88
{-# LANGUAGE QuantifiedConstraints #-}
9-
{-# LANGUAGE Safe #-}
9+
{-# LANGUAGE Trustworthy #-}
1010
{-# LANGUAGE TypeFamilies #-}
1111
{-# LANGUAGE TypeOperators #-}
1212

@@ -94,7 +94,6 @@ module Control.DeepSeq (
9494
import Control.Applicative
9595
import Control.Concurrent (MVar, ThreadId)
9696
import Control.Exception (MaskingState (..))
97-
import Data.Array
9897
import Data.Complex
9998
import Data.Fixed
10099
import Data.Functor.Compose
@@ -118,6 +117,8 @@ import Data.Void (Void, absurd)
118117
import Data.Word
119118
import Foreign.C.Types
120119
import Foreign.Ptr
120+
import GHC.Arr (Array)
121+
import qualified GHC.Arr
121122
import GHC.Fingerprint.Type (Fingerprint (..))
122123
import GHC.Generics
123124
import GHC.Stack.Types (CallStack (..), SrcLoc (..))
@@ -628,15 +629,16 @@ instance NFData2 Const where
628629
-- We should use MIN_VERSION array(0,5,1,1) but that's not possible.
629630
-- There isn't an underscore to not break C preprocessor
630631
instance (NFData a, NFData b) => NFData (Array a b) where
631-
rnf x = rnf (bounds x, Data.Array.elems x)
632+
rnf x = rnf (GHC.Arr.bounds x, GHC.Arr.elems x)
632633

633634
-- | @since 1.4.3.0
634635
instance (NFData a) => NFData1 (Array a) where
635-
liftRnf r x = rnf (bounds x) `seq` liftRnf r (Data.Array.elems x)
636+
liftRnf r x = rnf (GHC.Arr.bounds x) `seq` liftRnf r (GHC.Arr.elems x)
636637

637638
-- | @since 1.4.3.0
638639
instance NFData2 Array where
639-
liftRnf2 r r' x = liftRnf2 r r (bounds x) `seq` liftRnf r' (Data.Array.elems x)
640+
liftRnf2 r r' x =
641+
liftRnf2 r r (GHC.Arr.bounds x) `seq` liftRnf r' (GHC.Arr.elems x)
640642

641643
-- | @since 1.4.0.0
642644
instance NFData a => NFData (Down a) where rnf = rnf1

deepseq.cabal

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ library
6161
if impl(ghc >=9.0)
6262
build-depends: ghc-prim
6363

64-
build-depends: base >= 4.12 && < 4.21,
65-
array >= 0.4 && < 0.6
64+
build-depends: base >= 4.12 && < 4.21
6665
ghc-options: -Wall
6766

6867
exposed-modules: Control.DeepSeq
@@ -73,7 +72,6 @@ test-suite test
7372
main-is: Main.hs
7473
type: exitcode-stdio-1.0
7574
build-depends:
76-
array,
7775
base,
7876
deepseq,
7977
ghc-prim

0 commit comments

Comments
 (0)