Skip to content

Commit 84b8f3e

Browse files
committed
Merge pull request #58 from hvr/pr-deepseq14
Add support for `deepseq-1.4.0.0`
2 parents c0308f1 + 88d68b5 commit 84b8f3e

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

Data/Vector/Primitive.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ import qualified Data.Vector.Fusion.Bundle as Bundle
140140
import Data.Primitive.ByteArray
141141
import Data.Primitive ( Prim, sizeOf )
142142

143-
import Control.DeepSeq ( NFData )
143+
import Control.DeepSeq ( NFData(rnf) )
144144

145145
import Control.Monad ( liftM )
146146
import Control.Monad.ST ( ST )
@@ -176,7 +176,8 @@ data Vector a = Vector {-# UNPACK #-} !Int
176176
{-# UNPACK #-} !ByteArray -- ^ offset, length, underlying byte array
177177
deriving ( Typeable )
178178

179-
instance NFData (Vector a)
179+
instance NFData (Vector a) where
180+
rnf (Vector _ _ _) = ()
180181

181182
instance (Show a, Prim a) => Show (Vector a) where
182183
showsPrec = G.showsPrec

Data/Vector/Primitive/Mutable.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import Data.Primitive ( Prim, sizeOf )
5555
import Control.Monad.Primitive
5656
import Control.Monad ( liftM )
5757

58-
import Control.DeepSeq ( NFData )
58+
import Control.DeepSeq ( NFData(rnf) )
5959

6060
import Prelude hiding ( length, null, replicate, reverse, map, read,
6161
take, drop, splitAt, init, tail )
@@ -75,7 +75,8 @@ data MVector s a = MVector {-# UNPACK #-} !Int
7575
type IOVector = MVector RealWorld
7676
type STVector s = MVector s
7777

78-
instance NFData (MVector s a)
78+
instance NFData (MVector s a) where
79+
rnf (MVector _ _ _) = ()
7980

8081
instance Prim a => G.MVector MVector a where
8182
basicLength (MVector _ n _) = n

Data/Vector/Storable.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ import Foreign.ForeignPtr
146146
import Foreign.Ptr
147147
import Foreign.Marshal.Array ( advancePtr, copyArray )
148148

149-
import Control.DeepSeq ( NFData )
149+
import Control.DeepSeq ( NFData(rnf) )
150150

151151
import Control.Monad.ST ( ST )
152152
import Control.Monad.Primitive
@@ -184,7 +184,8 @@ data Vector a = Vector {-# UNPACK #-} !Int
184184
{-# UNPACK #-} !(ForeignPtr a)
185185
deriving ( Typeable )
186186

187-
instance NFData (Vector a)
187+
instance NFData (Vector a) where
188+
rnf (Vector _ _) = ()
188189

189190
instance (Show a, Storable a) => Show (Vector a) where
190191
showsPrec = G.showsPrec

Data/Vector/Storable/Mutable.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module Data.Vector.Storable.Mutable(
5757
unsafeWith
5858
) where
5959

60-
import Control.DeepSeq ( NFData )
60+
import Control.DeepSeq ( NFData(rnf) )
6161

6262
import qualified Data.Vector.Generic.Mutable as G
6363
import Data.Vector.Storable.Internal
@@ -96,7 +96,8 @@ data MVector s a = MVector {-# UNPACK #-} !Int
9696
type IOVector = MVector RealWorld
9797
type STVector s = MVector s
9898

99-
instance NFData (MVector s a)
99+
instance NFData (MVector s a) where
100+
rnf (MVector _ _) = ()
100101

101102
instance Storable a => G.MVector MVector a where
102103
{-# INLINE basicLength #-}

Data/Vector/Unboxed/Base.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE CPP, MultiParamTypeClasses, TypeFamilies, FlexibleContexts #-}
1+
{-# LANGUAGE BangPatterns, CPP, MultiParamTypeClasses, TypeFamilies, FlexibleContexts #-}
22
#if __GLASGOW_HASKELL__ >= 707
33
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
44
#endif
@@ -25,7 +25,7 @@ import qualified Data.Vector.Generic.Mutable as M
2525

2626
import qualified Data.Vector.Primitive as P
2727

28-
import Control.DeepSeq ( NFData )
28+
import Control.DeepSeq ( NFData(rnf) )
2929

3030
import Control.Monad.Primitive
3131
import Control.Monad ( liftM )
@@ -62,8 +62,8 @@ type instance G.Mutable Vector = MVector
6262

6363
class (G.Vector Vector a, M.MVector MVector a) => Unbox a
6464

65-
instance NFData (Vector a)
66-
instance NFData (MVector s a)
65+
instance NFData (Vector a) where rnf !_ = ()
66+
instance NFData (MVector s a) where rnf !_ = ()
6767

6868
-- -----------------
6969
-- Data and Typeable

vector.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Library
140140
Build-Depends: base >= 4.3 && < 4.9
141141
, primitive >= 0.5.0.1 && < 0.6
142142
, ghc-prim >= 0.2 && < 0.4
143-
, deepseq >= 1.1 && < 1.4
143+
, deepseq >= 1.1 && < 1.5
144144

145145
Ghc-Options: -O2 -Wall -fno-warn-orphans
146146

0 commit comments

Comments
 (0)