Skip to content

Commit 4861108

Browse files
authored
Drop support for GHC<8.8 (#549)
2 parents 1cf44fb + 40e0173 commit 4861108

File tree

14 files changed

+21
-142
lines changed

14 files changed

+21
-142
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ jobs:
1818
matrix:
1919
include:
2020
# Linux
21-
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.0.2" }
22-
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.2.2" }
23-
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.4.4" }
24-
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.6.5" }
2521
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.8.4" }
2622
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.10.7" }
2723
- { cabal: "3.14", os: ubuntu-24.04, ghc: "9.0.2" }
@@ -34,15 +30,11 @@ jobs:
3430
- { cabal: "3.14", os: ubuntu-24.04, ghc: "9.10.2" }
3531
- { cabal: "3.14", os: ubuntu-24.04, ghc: "9.12.2" }
3632
# Win
37-
- { cabal: "3.14", os: windows-latest, ghc: "8.4.4" }
3833
- { cabal: "3.14", os: windows-latest, ghc: "9.6.7" }
3934
- { cabal: "3.14", os: windows-latest, ghc: "9.8.4" }
4035
- { cabal: "3.14", os: windows-latest, ghc: "9.10.2" }
4136
- { cabal: "3.14", os: windows-latest, ghc: "9.12.2" }
42-
# Too flaky:
43-
# - { cabal: "3.6", os: windows-latest, ghc: "9.0.1" }
4437
# MacOS
45-
- { cabal: "3.14", os: macOS-13, ghc: "8.4.4" }
4638
# Fails with linker errors
4739
# > ld: warning: -single_module is obsolete
4840
# > <command line>: can't load framework: Security (not found)

vector-stream/src/Data/Stream/Monadic.hs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,24 +1555,11 @@ enumFromTo_double :: (Monad m, Ord a, RealFrac a) => a -> a -> Stream m a
15551555
enumFromTo_double n m = n `seq` m `seq` Stream step ini
15561556
where
15571557
lim = m + 1/2 -- important to float out
1558-
1559-
-- GHC changed definition of Enum for Double in GHC8.6 so we have to
1560-
-- accommodate both definitions in order to preserve validity of
1561-
-- rewrite rule
1562-
--
1563-
-- ISSUE: https://gitlab.haskell.org/ghc/ghc/issues/15081
1564-
-- COMMIT: https://gitlab.haskell.org/ghc/ghc/commit/4ffaf4b67773af4c72d92bb8b6c87b1a7d34ac0f
1565-
#if MIN_VERSION_base(4,12,0)
15661558
ini = 0
15671559
step x | x' <= lim = return $ Yield x' (x+1)
15681560
| otherwise = return $ Done
15691561
where
15701562
x' = x + n
1571-
#else
1572-
ini = n
1573-
step x | x <= lim = return $ Yield x (x+1)
1574-
| otherwise = return $ Done
1575-
#endif
15761563

15771564
{-# RULES
15781565

vector-stream/vector-stream.cabal

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ Description:
2222
as a backbone for vector package fusion functionality.
2323

2424
Tested-With:
25-
GHC == 8.0.2
26-
GHC == 8.2.2
27-
GHC == 8.4.4
28-
GHC == 8.6.5
2925
GHC == 8.8.4
3026
GHC == 8.10.7
3127
GHC == 9.0.2
@@ -51,7 +47,7 @@ Library
5147
Hs-Source-Dirs:
5248
src
5349

54-
Build-Depends: base >= 4.9 && < 4.23
50+
Build-Depends: base >= 4.13 && < 4.23
5551
, ghc-prim >= 0.2 && < 0.14
5652

5753
source-repository head

vector/src/Data/Vector.hs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,9 @@ import Data.Primitive.Array
184184
import qualified Data.Vector.Fusion.Bundle as Bundle
185185
import qualified Data.Vector.Generic as G
186186

187-
import Control.DeepSeq ( NFData(rnf)
188-
#if MIN_VERSION_deepseq(1,4,3)
189-
, NFData1(liftRnf)
190-
#endif
191-
)
187+
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))
192188

193189
import Control.Monad ( MonadPlus(..), liftM, ap )
194-
#if !MIN_VERSION_base(4,13,0)
195-
import Control.Monad (fail)
196-
#endif
197190
import Control.Monad.ST ( ST, runST )
198191
import Control.Monad.Primitive
199192
import qualified Control.Monad.Fail as Fail
@@ -223,19 +216,14 @@ data Vector a = Vector {-# UNPACK #-} !Int
223216
{-# UNPACK #-} !Int
224217
{-# UNPACK #-} !(Array a)
225218

226-
liftRnfV :: (a -> ()) -> Vector a -> ()
227-
liftRnfV elemRnf = foldl' (\_ -> elemRnf) ()
228-
229219
instance NFData a => NFData (Vector a) where
230-
rnf = liftRnfV rnf
220+
rnf = liftRnf rnf
231221
{-# INLINEABLE rnf #-}
232222

233-
#if MIN_VERSION_deepseq(1,4,3)
234223
-- | @since 0.12.1.0
235224
instance NFData1 Vector where
236-
liftRnf = liftRnfV
225+
liftRnf elemRnf = foldl' (\_ -> elemRnf) ()
237226
{-# INLINEABLE liftRnf #-}
238-
#endif
239227

240228
instance Show a => Show (Vector a) where
241229
showsPrec = G.showsPrec
@@ -348,11 +336,6 @@ instance Monad Vector where
348336
{-# INLINE (>>=) #-}
349337
(>>=) = flip concatMap
350338

351-
#if !(MIN_VERSION_base(4,13,0))
352-
{-# INLINE fail #-}
353-
fail = Fail.fail -- == \ _str -> empty
354-
#endif
355-
356339
-- | @since 0.12.1.0
357340
instance Fail.MonadFail Vector where
358341
{-# INLINE fail #-}

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,23 +1018,11 @@ enumFromTo_double n m = n `seq` m `seq` fromStream (Stream step ini) (Max (len n
10181018
l = truncate (y-x)+2
10191019

10201020
{-# INLINE_INNER step #-}
1021-
-- GHC changed definition of Enum for Double in GHC8.6 so we have to
1022-
-- accommodate both definitions in order to preserve validity of
1023-
-- rewrite rule
1024-
--
1025-
-- ISSUE: https://gitlab.haskell.org/ghc/ghc/issues/15081
1026-
-- COMMIT: https://gitlab.haskell.org/ghc/ghc/commit/4ffaf4b67773af4c72d92bb8b6c87b1a7d34ac0f
1027-
#if MIN_VERSION_base(4,12,0)
10281021
ini = 0
10291022
step x | x' <= lim = return $ Yield x' (x+1)
10301023
| otherwise = return $ Done
10311024
where
10321025
x' = x + n
1033-
#else
1034-
ini = n
1035-
step x | x <= lim = return $ Yield x (x+1)
1036-
| otherwise = return $ Done
1037-
#endif
10381026

10391027
{-# RULES
10401028

vector/src/Data/Vector/Primitive.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,7 @@ import qualified Data.Vector.Fusion.Bundle as Bundle
169169
import Data.Primitive.ByteArray
170170
import Data.Primitive ( Prim, sizeOf )
171171

172-
import Control.DeepSeq ( NFData(rnf)
173-
#if MIN_VERSION_deepseq(1,4,3)
174-
, NFData1(liftRnf)
175-
#endif
176-
)
172+
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))
177173

178174
import Control.Monad ( liftM )
179175
import Control.Monad.ST ( ST )
@@ -213,11 +209,9 @@ data Vector a = Vector {-# UNPACK #-} !Int -- ^ offset
213209
instance NFData (Vector a) where
214210
rnf (Vector _ _ _) = ()
215211

216-
#if MIN_VERSION_deepseq(1,4,3)
217212
-- | @since 0.12.1.0
218213
instance NFData1 Vector where
219214
liftRnf _ (Vector _ _ _) = ()
220-
#endif
221215

222216
instance (Show a, Prim a) => Show (Vector a) where
223217
showsPrec = G.showsPrec

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ import Data.Word ( Word8 )
7777
import Control.Monad.Primitive
7878
import Control.Monad ( liftM )
7979

80-
import Control.DeepSeq ( NFData(rnf)
81-
#if MIN_VERSION_deepseq(1,4,3)
82-
, NFData1(liftRnf)
83-
#endif
84-
)
80+
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))
8581

8682
import Prelude
8783
( Ord, Bool, Int, Maybe, Ordering(..)
@@ -116,10 +112,8 @@ type STVector s = MVector s
116112
instance NFData (MVector s a) where
117113
rnf (MVector _ _ _) = ()
118114

119-
#if MIN_VERSION_deepseq(1,4,3)
120115
instance NFData1 (MVector s) where
121116
liftRnf _ (MVector _ _ _) = ()
122-
#endif
123117

124118
instance Prim a => G.MVector MVector a where
125119
basicLength (MVector _ n _) = n

vector/src/Data/Vector/Storable.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,7 @@ import Foreign.ForeignPtr
178178
import Foreign.Ptr
179179
import Foreign.Marshal.Array ( advancePtr, copyArray )
180180

181-
import Control.DeepSeq ( NFData(rnf)
182-
#if MIN_VERSION_deepseq(1,4,3)
183-
, NFData1(liftRnf)
184-
#endif
185-
)
181+
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))
186182

187183
import Control.Monad.ST ( ST )
188184
import Control.Monad.Primitive
@@ -221,11 +217,9 @@ data Vector a = Vector {-# UNPACK #-} !Int
221217
instance NFData (Vector a) where
222218
rnf (Vector _ _) = ()
223219

224-
#if MIN_VERSION_deepseq(1,4,3)
225220
-- | @since 0.12.1.0
226221
instance NFData1 Vector where
227222
liftRnf _ (Vector _ _) = ()
228-
#endif
229223

230224
instance (Show a, Storable a) => Show (Vector a) where
231225
showsPrec = G.showsPrec

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ module Data.Vector.Storable.Mutable(
7676
Storable, PrimMonad, PrimState, RealWorld
7777
) where
7878

79-
import Control.DeepSeq ( NFData(rnf)
80-
#if MIN_VERSION_deepseq(1,4,3)
81-
, NFData1(liftRnf)
82-
#endif
83-
)
79+
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))
8480

8581
import qualified Data.Vector.Generic.Mutable as G
8682
import Data.Vector.Storable.Internal
@@ -134,10 +130,8 @@ type STVector s = MVector s
134130
instance NFData (MVector s a) where
135131
rnf (MVector _ _) = ()
136132

137-
#if MIN_VERSION_deepseq(1,4,3)
138133
instance NFData1 (MVector s) where
139134
liftRnf _ (MVector _ _) = ()
140-
#endif
141135

142136
instance Storable a => G.MVector MVector a where
143137
{-# INLINE basicLength #-}

vector/src/Data/Vector/Strict.hs

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,9 @@ import Data.Primitive.Array
184184
import qualified Data.Vector.Generic as G
185185
import qualified Data.Vector as V
186186

187-
import Control.DeepSeq ( NFData(rnf)
188-
#if MIN_VERSION_deepseq(1,4,3)
189-
, NFData1(liftRnf)
190-
#endif
191-
)
187+
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))
192188

193189
import Control.Monad ( MonadPlus(..), ap )
194-
#if !MIN_VERSION_base(4,13,0)
195-
import Control.Monad (fail)
196-
#endif
197190
import Control.Monad.ST ( ST, runST )
198191
import Control.Monad.Primitive
199192
import qualified Control.Monad.Fail as Fail
@@ -234,19 +227,14 @@ newtype Vector a = Vector (V.Vector a)
234227
-- parameters (e.g. Eq, Ord) and not OK to derive ones where new
235228
-- vector is created (e.g. Read, Functor)
236229

237-
liftRnfV :: (a -> ()) -> Vector a -> ()
238-
liftRnfV elemRnf = foldl' (\_ -> elemRnf) ()
239-
240230
instance NFData a => NFData (Vector a) where
241-
rnf = liftRnfV rnf
231+
rnf = liftRnf rnf
242232
{-# INLINEABLE rnf #-}
243233

244-
#if MIN_VERSION_deepseq(1,4,3)
245234
-- | @since 0.13.2.0
246235
instance NFData1 Vector where
247-
liftRnf = liftRnfV
236+
liftRnf elemRnf = foldl' (\_ -> elemRnf) ()
248237
{-# INLINEABLE liftRnf #-}
249-
#endif
250238

251239
instance Show a => Show (Vector a) where
252240
showsPrec = G.showsPrec
@@ -335,11 +323,6 @@ instance Monad Vector where
335323
{-# INLINE (>>=) #-}
336324
(>>=) = flip concatMap
337325

338-
#if !(MIN_VERSION_base(4,13,0))
339-
{-# INLINE fail #-}
340-
fail = Fail.fail -- == \ _str -> empty
341-
#endif
342-
343326
-- | @since 0.13.2.0
344327
instance Fail.MonadFail Vector where
345328
{-# INLINE fail #-}
@@ -2576,7 +2559,7 @@ toLazy (Vector v) = v
25762559
-- | /O(n)/ Convert lazy array to strict array. This function reduces
25772560
-- each element of vector to WHNF.
25782561
fromLazy :: V.Vector a -> Vector a
2579-
fromLazy vec = liftRnfV (`seq` ()) v `seq` v where v = Vector vec
2562+
fromLazy vec = liftRnf (`seq` ()) v `seq` v where v = Vector vec
25802563

25812564

25822565
-- Conversions - Arrays
@@ -2587,7 +2570,7 @@ fromLazy vec = liftRnfV (`seq` ()) v `seq` v where v = Vector vec
25872570
-- @since 0.13.2.0
25882571
fromArray :: Array a -> Vector a
25892572
{-# INLINE fromArray #-}
2590-
fromArray arr = liftRnfV (`seq` ()) vec `seq` vec
2573+
fromArray arr = liftRnf (`seq` ()) vec `seq` vec
25912574
where
25922575
vec = Vector $ V.fromArray arr
25932576

@@ -2625,7 +2608,7 @@ unsafeFromArraySlice ::
26252608
-> Int -- ^ Length
26262609
-> Vector a
26272610
{-# INLINE unsafeFromArraySlice #-}
2628-
unsafeFromArraySlice arr offset len = liftRnfV (`seq` ()) vec `seq` vec
2611+
unsafeFromArraySlice arr offset len = liftRnf (`seq` ()) vec `seq` vec
26292612
where vec = Vector (V.unsafeFromArraySlice arr offset len)
26302613

26312614

0 commit comments

Comments
 (0)