Skip to content
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
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ jobs:
matrix:
include:
# Linux
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.0.2" }
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.2.2" }
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.4.4" }
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.6.5" }
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.8.4" }
- { cabal: "3.14", os: ubuntu-24.04, ghc: "8.10.7" }
- { cabal: "3.14", os: ubuntu-24.04, ghc: "9.0.2" }
Expand All @@ -34,15 +30,11 @@ jobs:
- { cabal: "3.14", os: ubuntu-24.04, ghc: "9.10.2" }
- { cabal: "3.14", os: ubuntu-24.04, ghc: "9.12.2" }
# Win
- { cabal: "3.14", os: windows-latest, ghc: "8.4.4" }
- { cabal: "3.14", os: windows-latest, ghc: "9.6.7" }
- { cabal: "3.14", os: windows-latest, ghc: "9.8.4" }
- { cabal: "3.14", os: windows-latest, ghc: "9.10.2" }
- { cabal: "3.14", os: windows-latest, ghc: "9.12.2" }
# Too flaky:
# - { cabal: "3.6", os: windows-latest, ghc: "9.0.1" }
# MacOS
- { cabal: "3.14", os: macOS-13, ghc: "8.4.4" }
# Fails with linker errors
# > ld: warning: -single_module is obsolete
# > <command line>: can't load framework: Security (not found)
Expand Down
13 changes: 0 additions & 13 deletions vector-stream/src/Data/Stream/Monadic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1555,24 +1555,11 @@ enumFromTo_double :: (Monad m, Ord a, RealFrac a) => a -> a -> Stream m a
enumFromTo_double n m = n `seq` m `seq` Stream step ini
where
lim = m + 1/2 -- important to float out

-- GHC changed definition of Enum for Double in GHC8.6 so we have to
-- accommodate both definitions in order to preserve validity of
-- rewrite rule
--
-- ISSUE: https://gitlab.haskell.org/ghc/ghc/issues/15081
-- COMMIT: https://gitlab.haskell.org/ghc/ghc/commit/4ffaf4b67773af4c72d92bb8b6c87b1a7d34ac0f
#if MIN_VERSION_base(4,12,0)
ini = 0
step x | x' <= lim = return $ Yield x' (x+1)
| otherwise = return $ Done
where
x' = x + n
#else
ini = n
step x | x <= lim = return $ Yield x (x+1)
| otherwise = return $ Done
#endif

{-# RULES

Expand Down
6 changes: 1 addition & 5 deletions vector-stream/vector-stream.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Description:
as a backbone for vector package fusion functionality.

Tested-With:
GHC == 8.0.2
GHC == 8.2.2
GHC == 8.4.4
GHC == 8.6.5
GHC == 8.8.4
GHC == 8.10.7
GHC == 9.0.2
Expand All @@ -51,7 +47,7 @@ Library
Hs-Source-Dirs:
src

Build-Depends: base >= 4.9 && < 4.23
Build-Depends: base >= 4.13 && < 4.23
, ghc-prim >= 0.2 && < 0.14

source-repository head
Expand Down
23 changes: 3 additions & 20 deletions vector/src/Data/Vector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,9 @@ import Data.Primitive.Array
import qualified Data.Vector.Fusion.Bundle as Bundle
import qualified Data.Vector.Generic as G

import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
)
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))

import Control.Monad ( MonadPlus(..), liftM, ap )
#if !MIN_VERSION_base(4,13,0)
import Control.Monad (fail)
#endif
import Control.Monad.ST ( ST, runST )
import Control.Monad.Primitive
import qualified Control.Monad.Fail as Fail
Expand Down Expand Up @@ -223,19 +216,14 @@ data Vector a = Vector {-# UNPACK #-} !Int
{-# UNPACK #-} !Int
{-# UNPACK #-} !(Array a)

liftRnfV :: (a -> ()) -> Vector a -> ()
liftRnfV elemRnf = foldl' (\_ -> elemRnf) ()

instance NFData a => NFData (Vector a) where
rnf = liftRnfV rnf
rnf = liftRnf rnf
{-# INLINEABLE rnf #-}

#if MIN_VERSION_deepseq(1,4,3)
-- | @since 0.12.1.0
instance NFData1 Vector where
liftRnf = liftRnfV
liftRnf elemRnf = foldl' (\_ -> elemRnf) ()
{-# INLINEABLE liftRnf #-}
#endif

instance Show a => Show (Vector a) where
showsPrec = G.showsPrec
Expand Down Expand Up @@ -348,11 +336,6 @@ instance Monad Vector where
{-# INLINE (>>=) #-}
(>>=) = flip concatMap

#if !(MIN_VERSION_base(4,13,0))
{-# INLINE fail #-}
fail = Fail.fail -- == \ _str -> empty
#endif

-- | @since 0.12.1.0
instance Fail.MonadFail Vector where
{-# INLINE fail #-}
Expand Down
12 changes: 0 additions & 12 deletions vector/src/Data/Vector/Fusion/Bundle/Monadic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,23 +1018,11 @@ enumFromTo_double n m = n `seq` m `seq` fromStream (Stream step ini) (Max (len n
l = truncate (y-x)+2

{-# INLINE_INNER step #-}
-- GHC changed definition of Enum for Double in GHC8.6 so we have to
-- accommodate both definitions in order to preserve validity of
-- rewrite rule
--
-- ISSUE: https://gitlab.haskell.org/ghc/ghc/issues/15081
-- COMMIT: https://gitlab.haskell.org/ghc/ghc/commit/4ffaf4b67773af4c72d92bb8b6c87b1a7d34ac0f
#if MIN_VERSION_base(4,12,0)
ini = 0
step x | x' <= lim = return $ Yield x' (x+1)
| otherwise = return $ Done
where
x' = x + n
#else
ini = n
step x | x <= lim = return $ Yield x (x+1)
| otherwise = return $ Done
#endif

{-# RULES

Expand Down
8 changes: 1 addition & 7 deletions vector/src/Data/Vector/Primitive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ import qualified Data.Vector.Fusion.Bundle as Bundle
import Data.Primitive.ByteArray
import Data.Primitive ( Prim, sizeOf )

import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
)
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))

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

#if MIN_VERSION_deepseq(1,4,3)
-- | @since 0.12.1.0
instance NFData1 Vector where
liftRnf _ (Vector _ _ _) = ()
#endif

instance (Show a, Prim a) => Show (Vector a) where
showsPrec = G.showsPrec
Expand Down
8 changes: 1 addition & 7 deletions vector/src/Data/Vector/Primitive/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ import Data.Word ( Word8 )
import Control.Monad.Primitive
import Control.Monad ( liftM )

import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
)
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))

import Prelude
( Ord, Bool, Int, Maybe, Ordering(..)
Expand Down Expand Up @@ -116,10 +112,8 @@ type STVector s = MVector s
instance NFData (MVector s a) where
rnf (MVector _ _ _) = ()

#if MIN_VERSION_deepseq(1,4,3)
instance NFData1 (MVector s) where
liftRnf _ (MVector _ _ _) = ()
#endif

instance Prim a => G.MVector MVector a where
basicLength (MVector _ n _) = n
Expand Down
8 changes: 1 addition & 7 deletions vector/src/Data/Vector/Storable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ import Foreign.ForeignPtr
import Foreign.Ptr
import Foreign.Marshal.Array ( advancePtr, copyArray )

import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
)
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))

import Control.Monad.ST ( ST )
import Control.Monad.Primitive
Expand Down Expand Up @@ -221,11 +217,9 @@ data Vector a = Vector {-# UNPACK #-} !Int
instance NFData (Vector a) where
rnf (Vector _ _) = ()

#if MIN_VERSION_deepseq(1,4,3)
-- | @since 0.12.1.0
instance NFData1 Vector where
liftRnf _ (Vector _ _) = ()
#endif

instance (Show a, Storable a) => Show (Vector a) where
showsPrec = G.showsPrec
Expand Down
8 changes: 1 addition & 7 deletions vector/src/Data/Vector/Storable/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ module Data.Vector.Storable.Mutable(
Storable, PrimMonad, PrimState, RealWorld
) where

import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
)
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))

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

#if MIN_VERSION_deepseq(1,4,3)
instance NFData1 (MVector s) where
liftRnf _ (MVector _ _) = ()
#endif

instance Storable a => G.MVector MVector a where
{-# INLINE basicLength #-}
Expand Down
29 changes: 6 additions & 23 deletions vector/src/Data/Vector/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,9 @@ import Data.Primitive.Array
import qualified Data.Vector.Generic as G
import qualified Data.Vector as V

import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
)
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf))

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

liftRnfV :: (a -> ()) -> Vector a -> ()
liftRnfV elemRnf = foldl' (\_ -> elemRnf) ()

instance NFData a => NFData (Vector a) where
rnf = liftRnfV rnf
rnf = liftRnf rnf
{-# INLINEABLE rnf #-}

#if MIN_VERSION_deepseq(1,4,3)
-- | @since 0.13.2.0
instance NFData1 Vector where
liftRnf = liftRnfV
liftRnf elemRnf = foldl' (\_ -> elemRnf) ()
{-# INLINEABLE liftRnf #-}
#endif

instance Show a => Show (Vector a) where
showsPrec = G.showsPrec
Expand Down Expand Up @@ -335,11 +323,6 @@ instance Monad Vector where
{-# INLINE (>>=) #-}
(>>=) = flip concatMap

#if !(MIN_VERSION_base(4,13,0))
{-# INLINE fail #-}
fail = Fail.fail -- == \ _str -> empty
#endif

-- | @since 0.13.2.0
instance Fail.MonadFail Vector where
{-# INLINE fail #-}
Expand Down Expand Up @@ -2576,7 +2559,7 @@ toLazy (Vector v) = v
-- | /O(n)/ Convert lazy array to strict array. This function reduces
-- each element of vector to WHNF.
fromLazy :: V.Vector a -> Vector a
fromLazy vec = liftRnfV (`seq` ()) v `seq` v where v = Vector vec
fromLazy vec = liftRnf (`seq` ()) v `seq` v where v = Vector vec


-- Conversions - Arrays
Expand All @@ -2587,7 +2570,7 @@ fromLazy vec = liftRnfV (`seq` ()) v `seq` v where v = Vector vec
-- @since 0.13.2.0
fromArray :: Array a -> Vector a
{-# INLINE fromArray #-}
fromArray arr = liftRnfV (`seq` ()) vec `seq` vec
fromArray arr = liftRnf (`seq` ()) vec `seq` vec
where
vec = Vector $ V.fromArray arr

Expand Down Expand Up @@ -2625,7 +2608,7 @@ unsafeFromArraySlice ::
-> Int -- ^ Length
-> Vector a
{-# INLINE unsafeFromArraySlice #-}
unsafeFromArraySlice arr offset len = liftRnfV (`seq` ()) vec `seq` vec
unsafeFromArraySlice arr offset len = liftRnf (`seq` ()) vec `seq` vec
where vec = Vector (V.unsafeFromArraySlice arr offset len)


Expand Down
10 changes: 2 additions & 8 deletions vector/src/Data/Vector/Unboxed/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ import qualified Data.Vector.Primitive as P

import Control.Applicative (Const(..))

import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
, force
)
import Control.DeepSeq ( NFData(rnf), NFData1(liftRnf), force)

import Control.Monad.Primitive
import Control.Monad ( liftM )
Expand Down Expand Up @@ -79,14 +74,13 @@ class (G.Vector Vector a, M.MVector MVector a) => Unbox a
instance NFData (Vector a) where rnf !_ = ()
instance NFData (MVector s a) where rnf !_ = ()

#if MIN_VERSION_deepseq(1,4,3)
-- | @since 0.12.1.0
instance NFData1 Vector where
liftRnf _ !_ = ()
-- | @since 0.12.1.0
instance NFData1 (MVector s) where
liftRnf _ !_ = ()
#endif


instance (Data a, Unbox a) => Data (Vector a) where
gfoldl = G.gfoldl
Expand Down
5 changes: 0 additions & 5 deletions vector/tests-inspect/main.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{-# LANGUAGE CPP #-}
module Main (main) where

import qualified Inspect
#if MIN_VERSION_base(4,12,0)
import qualified Inspect.DerivingVia
#endif
import Test.Tasty (defaultMain,testGroup)

main :: IO ()
main = defaultMain $ testGroup "tests"
[ Inspect.tests
#if MIN_VERSION_base(4,12,0)
, Inspect.DerivingVia.tests
#endif
]
5 changes: 0 additions & 5 deletions vector/tests/Tests/Deriving.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
Expand All @@ -10,9 +9,7 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnboxedTuples #-}
#if MIN_VERSION_base(4,12,0)
{-# LANGUAGE DerivingVia #-}
#endif
-- |
-- These tests make sure that derived Unbox instances actually works.
-- It's distressingly easy to forget to export some constructor and
Expand All @@ -31,7 +28,6 @@ import qualified Data.Vector.Storable as VS
import qualified Data.Vector.Primitive as VP
import qualified Data.Vector.Unboxed as VU

#if MIN_VERSION_base(4,12,0)
----------------------------------------------------------------
-- Primitive

Expand Down Expand Up @@ -183,4 +179,3 @@ deriving via (FooAs a `VU.As` (Int, a)) instance VU.Unbox a => VGM.MVector VU.MV
deriving via (FooAs a `VU.As` (Int, a)) instance VU.Unbox a => VG.Vector VU.Vector (FooAs a)
instance VU.Unbox a => VU.Unbox (FooAs a)

#endif
Loading
Loading