Skip to content

Commit 58ddc36

Browse files
committed
Drop UNPACK pragma for Int fields
For a long time pointer-sized strict fields are unboxed automatically
1 parent f50aa33 commit 58ddc36

8 files changed

Lines changed: 22 additions & 22 deletions

File tree

vector/src/Data/Vector/Fusion/Bundle/Size.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ module Data.Vector.Fusion.Bundle.Size (
2020
import Data.Vector.Fusion.Util ( delay_inline )
2121

2222
-- | Size hint
23-
data Size = Exact {-# UNPACK #-} !Int -- ^ Exact size
24-
| Max {-# UNPACK #-} !Int -- ^ Upper bound on the size
23+
data Size = Exact !Int -- ^ Exact size
24+
| Max !Int -- ^ Upper bound on the size
2525
| Unknown -- ^ Unknown size
2626
deriving( Eq, Show )
2727

vector/src/Data/Vector/Mutable/Unsafe.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ type role MVector nominal representational
3232

3333
-- | Mutable boxed vectors keyed on the monad they live in ('IO' or @'ST' s@).
3434
data MVector s a = MVector
35-
{ unsafeOffset :: {-# UNPACK #-} !Int -- ^ Offset in underlying array
36-
, unsafeSize :: {-# UNPACK #-} !Int -- ^ Size of slice
35+
{ unsafeOffset :: !Int -- ^ Offset in underlying array
36+
, unsafeSize :: !Int -- ^ Size of slice
3737
, unsafeMutableArray :: {-# UNPACK #-} !(MutableArray s a)
3838
-- ^ Underlying mutable array
3939
}

vector/src/Data/Vector/Primitive/Mutable/Unsafe.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ type role MVector nominal nominal
4444

4545
-- | Mutable vectors of primitive types.
4646
data MVector s a = MVector
47-
{ unsafeOffset :: {-# UNPACK #-} !Int
47+
{ unsafeOffset :: !Int
4848
-- ^ Offset into the `unsafeMutableByteArray` in number of elements, not bytes
49-
, unsafeSize :: {-# UNPACK #-} !Int
49+
, unsafeSize :: !Int
5050
-- ^ Size of the mutable vector in number of elements, not bytes
5151
, unsafeMutableByteArray :: {-# UNPACK #-} !(MutableByteArray s)
5252
-- ^ Underlying mutable byte array

vector/src/Data/Vector/Primitive/Unsafe.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ type role Vector nominal
4949

5050
-- | Unboxed vectors of primitive types.
5151
data Vector a = Vector
52-
{ unsafeOffset :: {-# UNPACK #-} !Int
52+
{ unsafeOffset :: !Int
5353
-- ^ Offset into `unsafeByteArray` in number of elements, not bytes
54-
, unsafeSize :: {-# UNPACK #-} !Int
54+
, unsafeSize :: !Int
5555
-- ^ Number of elements in number of elements, not bytes
5656
, unsafeByteArray :: {-# UNPACK #-} !ByteArray
5757
-- ^ Underlying byte array

vector/src/Data/Vector/Storable/Mutable/Unsafe.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type role MVector nominal nominal
5959

6060
-- | Mutable 'Storable'-based vectors.
6161
data MVector s a = MVector
62-
{ unsafeSize :: {-# UNPACK #-} !Int
62+
{ unsafeSize :: !Int
6363
-- ^ Number of elements in a mutable vector
6464
, unsafeForeignPtr :: {-# UNPACK #-} !(ForeignPtr a)
6565
-- ^ Underlying buffer as a `ForeignPtr`, which is allowed to be mutated

vector/src/Data/Vector/Storable/Unsafe.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ unsafeCoerceVector = unsafeCoerce
6464

6565
-- | 'Storable'-based vectors.
6666
data Vector a = Vector
67-
{ unsafeSize :: {-# UNPACK #-} !Int
67+
{ unsafeSize :: !Int
6868
-- ^ Number of elements in a vector
6969
, unsafeForeignPtr :: {-# UNPACK #-} !(ForeignPtr a)
7070
-- ^ Underlying buffer as a `ForeignPtr`, which mustn't be mutated

vector/src/Data/Vector/Unboxed/Unsafe.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,10 +1113,10 @@ instance Unbox (f (g a)) => Unbox (Compose f g a)
11131113
-- ------
11141114

11151115
data instance MVector s (a, b)
1116-
= MV_2 {-# UNPACK #-} !Int !(MVector s a)
1116+
= MV_2 !Int !(MVector s a)
11171117
!(MVector s b)
11181118
data instance Vector (a, b)
1119-
= V_2 {-# UNPACK #-} !Int !(Vector a)
1119+
= V_2 !Int !(Vector a)
11201120
!(Vector b)
11211121
instance (Unbox a, Unbox b) => Unbox (a, b)
11221122
instance (Unbox a, Unbox b) => M.MVector MVector (a, b) where
@@ -1220,11 +1220,11 @@ instance (Unbox a, Unbox b) => G.Vector Vector (a, b) where
12201220
. G.elemseq (undefined :: Vector b) b
12211221

12221222
data instance MVector s (a, b, c)
1223-
= MV_3 {-# UNPACK #-} !Int !(MVector s a)
1223+
= MV_3 !Int !(MVector s a)
12241224
!(MVector s b)
12251225
!(MVector s c)
12261226
data instance Vector (a, b, c)
1227-
= V_3 {-# UNPACK #-} !Int !(Vector a)
1227+
= V_3 !Int !(Vector a)
12281228
!(Vector b)
12291229
!(Vector c)
12301230
instance (Unbox a, Unbox b, Unbox c) => Unbox (a, b, c)
@@ -1351,12 +1351,12 @@ instance (Unbox a,
13511351
. G.elemseq (undefined :: Vector c) c
13521352

13531353
data instance MVector s (a, b, c, d)
1354-
= MV_4 {-# UNPACK #-} !Int !(MVector s a)
1354+
= MV_4 !Int !(MVector s a)
13551355
!(MVector s b)
13561356
!(MVector s c)
13571357
!(MVector s d)
13581358
data instance Vector (a, b, c, d)
1359-
= V_4 {-# UNPACK #-} !Int !(Vector a)
1359+
= V_4 !Int !(Vector a)
13601360
!(Vector b)
13611361
!(Vector c)
13621362
!(Vector d)
@@ -1513,13 +1513,13 @@ instance (Unbox a,
15131513
. G.elemseq (undefined :: Vector d) d
15141514

15151515
data instance MVector s (a, b, c, d, e)
1516-
= MV_5 {-# UNPACK #-} !Int !(MVector s a)
1516+
= MV_5 !Int !(MVector s a)
15171517
!(MVector s b)
15181518
!(MVector s c)
15191519
!(MVector s d)
15201520
!(MVector s e)
15211521
data instance Vector (a, b, c, d, e)
1522-
= V_5 {-# UNPACK #-} !Int !(Vector a)
1522+
= V_5 !Int !(Vector a)
15231523
!(Vector b)
15241524
!(Vector c)
15251525
!(Vector d)
@@ -1708,14 +1708,14 @@ instance (Unbox a,
17081708
. G.elemseq (undefined :: Vector e) e
17091709

17101710
data instance MVector s (a, b, c, d, e, f)
1711-
= MV_6 {-# UNPACK #-} !Int !(MVector s a)
1711+
= MV_6 !Int !(MVector s a)
17121712
!(MVector s b)
17131713
!(MVector s c)
17141714
!(MVector s d)
17151715
!(MVector s e)
17161716
!(MVector s f)
17171717
data instance Vector (a, b, c, d, e, f)
1718-
= V_6 {-# UNPACK #-} !Int !(Vector a)
1718+
= V_6 !Int !(Vector a)
17191719
!(Vector b)
17201720
!(Vector c)
17211721
!(Vector d)

vector/src/Data/Vector/Unsafe.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ import qualified GHC.Exts as Exts (IsList(..))
5151

5252
-- | Lazy boxed vectors, supporting efficient slicing.
5353
data Vector a = Vector
54-
{ unsafeOffset :: {-# UNPACK #-} !Int -- ^ Offset in underlying array
55-
, unsafeSize :: {-# UNPACK #-} !Int -- ^ Size of slice
54+
{ unsafeOffset :: !Int -- ^ Offset in underlying array
55+
, unsafeSize :: !Int -- ^ Size of slice
5656
, unsafeArray :: {-# UNPACK #-} !(Array a)
5757
-- ^ Underlying immutable array
5858
}

0 commit comments

Comments
 (0)