hybrid-vectors 0.2.4 → 0.2.5
raw patch · 3 files changed
+14/−77 lines, 3 filesdep ~basedep ~vectorPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, vector
API changes (from Hackage documentation)
Files
- hybrid-vectors.cabal +11/−17
- src/Data/Vector/Hybrid/Internal.hs +3/−56
- src/Data/Vector/Hybrid/Mutable.hs +0/−4
hybrid-vectors.cabal view
@@ -1,6 +1,6 @@ name: hybrid-vectors category: Data, Vector-version: 0.2.4+version: 0.2.5 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -17,13 +17,7 @@ .gitignore .vim.custom description: Hybrid vectors e.g. Mixed Boxed/Unboxed vectors.-tested-with: GHC == 7.0.4- , GHC == 7.2.2- , GHC == 7.4.2- , GHC == 7.6.3- , GHC == 7.8.4- , GHC == 7.10.3- , GHC == 8.0.2+tested-with: GHC == 8.0.2 , GHC == 8.2.2 , GHC == 8.4.4 , GHC == 8.6.5@@ -31,8 +25,11 @@ , GHC == 8.10.7 , GHC == 9.0.2 , GHC == 9.2.8- , GHC == 9.4.5- , GHC == 9.6.2+ , GHC == 9.4.8+ , GHC == 9.6.6+ , GHC == 9.8.4+ , GHC == 9.10.1+ , GHC == 9.12.1 source-repository head type: git@@ -40,10 +37,10 @@ library build-depends:- base >= 4 && < 5,- deepseq >= 1.1 && < 1.5,- primitive >= 0.5 && < 0.9,- vector >= 0.10 && < 0.14,+ base >= 4.9 && < 5,+ deepseq >= 1.1 && < 1.6,+ primitive >= 0.5 && < 0.10,+ vector >= 0.11 && < 0.14, semigroups >= 0.9 && < 1 hs-source-dirs: src@@ -55,9 +52,6 @@ ghc-options: -Wall -O2 default-language: Haskell2010-- if impl(ghc<6.13)- Ghc-Options: -finline-if-enough-args -fno-method-sharing if impl(ghc >= 8.6) ghc-options: -Wno-star-is-type
src/Data/Vector/Hybrid/Internal.hs view
@@ -1,17 +1,9 @@-{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, GADTs #-}+{-# LANGUAGE CPP, FlexibleInstances, GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving, KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -#ifndef MIN_VERSION_base-#define MIN_VERSION_base(x,y,z) 1-#endif--#ifndef MIN_VERSION_vector-#define MIN_VERSION_vector(x,y,z) 1-#endif- module Data.Vector.Hybrid.Internal ( MVector(..) , Vector(..)@@ -21,16 +13,10 @@ import qualified Data.Foldable as F import Data.Monoid import Data.Semigroup+import Data.Vector.Fusion.Bundle as Stream import qualified Data.Vector.Generic as G import qualified Data.Vector.Generic.Mutable as GM --#if MIN_VERSION_vector(0,11,0)-import Data.Vector.Fusion.Bundle as Stream-#else-import Data.Vector.Fusion.Stream as Stream-#endif- import Data.Data import Prelude hiding (drop, init, length, map, null, read, replicate, reverse, tail, take)@@ -39,26 +25,6 @@ data MVector :: (* -> * -> *) -> (* -> * -> *) -> * -> * -> * where MV :: !(u s a) -> !(v s b) -> MVector u v s (a, b) -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 707- deriving Typeable--#define Typeable1 Typeable--#else---- custom Typeable-instance (Typeable2 u, Typeable2 v) => Typeable2 (MVector u v) where- typeOf2 (_ :: MVector u v s ab) = mkTyConApp mvectorTyCon [typeOf2 (undefined :: u s a), typeOf2 (undefined :: v s b)]--mvectorTyCon :: TyCon-#if MIN_VERSION_base(4,4,0)-mvectorTyCon = mkTyCon3 "hybrid-vectors" "Data.Vector.Hybrid.Internal" "MVector"-#else-mvectorTyCon = mkTyCon "Data.Vector.Hybrid.Internal.MVector"-#endif--#endif- instance (GM.MVector u a, GM.MVector v b) => GM.MVector (MVector u v) (a, b) where basicLength (MV ks _) = GM.basicLength ks {-# INLINE basicLength #-}@@ -94,32 +60,13 @@ {-# INLINE basicUnsafeMove #-} basicUnsafeGrow (MV ks vs) n = liftM2 MV (GM.basicUnsafeGrow ks n) (GM.basicUnsafeGrow vs n) {-# INLINE basicUnsafeGrow #-}-#if MIN_VERSION_vector(0,11,0) basicInitialize (MV ks vs) = GM.basicInitialize ks >> GM.basicInitialize vs {-# INLINE basicInitialize #-}-#endif -- hybrid vectors data Vector :: (* -> *) -> (* -> *) -> * -> * where V :: !(u a) -> !(v b) -> Vector u v (a, b) -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 707- deriving Typeable-#else---- custom Typeable-instance (Typeable1 u, Typeable1 v) => Typeable1 (Vector u v) where- typeOf1 (_ :: Vector u v ab) = mkTyConApp vectorTyCon [typeOf1 (undefined :: u a), typeOf1 (undefined :: v b)]--vectorTyCon :: TyCon-#if MIN_VERSION_base(4,4,0)-vectorTyCon = mkTyCon3 "hybrid-vectors" "Data.Vector.Hybrid.Internal" "Vector"-#else-vectorTyCon = mkTyCon "Data.Vector.Hybrid.Internal.Vector"-#endif--#endif- type instance G.Mutable (Vector u v) = MVector (G.Mutable u) (G.Mutable v) instance (G.Vector u a, G.Vector v b) => G.Vector (Vector u v) (a, b) where@@ -161,7 +108,7 @@ readPrec = G.readPrec readListPrec = readListPrecDefault -instance (Data a, Data b, Typeable1 u, Typeable1 v, G.Vector u a, G.Vector v b, c ~ (a, b)) => Data (Vector u v c) where+instance (Data a, Data b, Typeable u, Typeable v, G.Vector u a, G.Vector v b, c ~ (a, b)) => Data (Vector u v c) where gfoldl = G.gfoldl toConstr _ = error "toConstr" -- TODO: virtual constructor gunfold _ _ = error "gunfold" -- TODO: virtual constructor
src/Data/Vector/Hybrid/Mutable.hs view
@@ -9,10 +9,6 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} -#ifndef MIN_VERSION_base-#define MIN_VERSION_base(x,y,z) 1-#endif- module Data.Vector.Hybrid.Mutable ( MVector , IOVector