packages feed

fixed-vector-binary 1.0.0.2 → 2.0.0.0

raw patch · 4 files changed

+40/−129 lines, 4 filesdep −fixed-vector-binarydep −tastydep −tasty-quickcheckdep ~basedep ~fixed-vectorPVP ok

version bump matches the API change (PVP)

Dependencies removed: fixed-vector-binary, tasty, tasty-quickcheck

Dependency ranges changed: base, fixed-vector

API changes (from Hackage documentation)

- Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.Arity n, Data.Primitive.Types.Prim a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Data.Vector.Fixed.Primitive.Vec n a)
- Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.Arity n, Foreign.Storable.Storable a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Data.Vector.Fixed.Storable.Vec n a)
- Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Unboxed.Unbox n a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Data.Vector.Fixed.Unboxed.Vec n a)
+ Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.Arity n, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Data.Vector.Fixed.Strict.Vec n a)
+ Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.Arity n, Data.Binary.Class.Binary a, Data.Primitive.Types.Prim a) => Data.Binary.Class.Binary (Data.Vector.Fixed.Primitive.Vec n a)
+ Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.Arity n, Data.Binary.Class.Binary a, Data.Vector.Fixed.Unboxed.Unbox n a) => Data.Binary.Class.Binary (Data.Vector.Fixed.Unboxed.Vec n a)
+ Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.Arity n, Data.Binary.Class.Binary a, Foreign.Storable.Storable a) => Data.Binary.Class.Binary (Data.Vector.Fixed.Storable.Vec n a)
+ Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.ArityPeano n, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Data.Vector.Fixed.VecPeano n a)
+ Data.Vector.Fixed.Instances.Binary: instance (Data.Vector.Fixed.Cont.Vector v a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Data.Vector.Fixed.ViaFixed v a)

Files

ChangeLog.md view
@@ -1,14 +1,15 @@-Changes in 1.0.0.2--  * GHC 8.6+ compatibility for tests as well--Changes in 1.0.0.1--  * GHC 8.6 compatibility+1.0.0.2+-------+* GHC 8.6+ compatibility for tests as well -Changes in 1.0.0.0+1.0.0.1+-------+* GHC 8.6 compatibility -  * Compatibility with fixed-vector-1.0-Changes in 0.6.0.0+1.0.0.0+-------+* Compatibility with fixed-vector-1.0 -  * Initial release+0.6.0.0+-------+* Initial release
Data/Vector/Fixed/Instances/Binary.hs view
@@ -1,4 +1,6 @@+{-# LANGUAGE DerivingVia          #-} {-# LANGUAGE FlexibleContexts     #-}+{-# LANGUAGE StandaloneDeriving   #-} {-# LANGUAGE TypeFamilies         #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-}@@ -6,34 +8,29 @@ --   vector module Data.Vector.Fixed.Instances.Binary where -import           Data.Vector.Fixed             (Arity)+import           Data.Vector.Fixed             (Arity,ArityPeano,ViaFixed(..),Vector) import qualified Data.Vector.Fixed           as F-import qualified Data.Vector.Fixed.Boxed     as B-import qualified Data.Vector.Fixed.Unboxed   as U-import qualified Data.Vector.Fixed.Primitive as P-import qualified Data.Vector.Fixed.Storable  as S+import qualified Data.Vector.Fixed.Boxed     as FB+import qualified Data.Vector.Fixed.Strict    as FF+import qualified Data.Vector.Fixed.Unboxed   as FU+import qualified Data.Vector.Fixed.Primitive as FP+import qualified Data.Vector.Fixed.Storable  as FS import           Data.Binary                   (Binary(..)) --instance (Arity n, Binary a) => Binary (B.Vec n a) where-  put = F.mapM_ put-  get = F.replicateM get--instance (Arity n, P.Prim a, Binary a) => Binary (P.Vec n a) where-  put = F.mapM_ put-  get = F.replicateM get--instance (Arity n, S.Storable a, Binary a) => Binary (S.Vec n a) where+instance (Vector v a, Binary a) => Binary (ViaFixed v a) where   put = F.mapM_ put   get = F.replicateM get+  {-# INLINE put #-}+  {-# INLINE get #-} -instance (U.Unbox n a, Binary a) => Binary (U.Vec n a) where-  put = F.mapM_ put-  get = F.replicateM get+deriving via ViaFixed (FB.Vec n) a instance (Arity n, Binary a)                => Binary (FB.Vec n a)+deriving via ViaFixed (FF.Vec n) a instance (Arity n, Binary a)                => Binary (FF.Vec n a)+deriving via ViaFixed (FP.Vec n) a instance (Arity n, Binary a, FP.Prim a)     => Binary (FP.Vec n a)+deriving via ViaFixed (FS.Vec n) a instance (Arity n, Binary a, FS.Storable a) => Binary (FS.Vec n a)+deriving via ViaFixed (FU.Vec n) a instance (Arity n, Binary a, FU.Unbox n a)  => Binary (FU.Vec n a) -instance (Arity n, Binary a) => Binary (F.VecList n a) where-  put = F.mapM_ put-  get = F.replicateM get+deriving via ViaFixed (F.VecList  n) a instance (Arity n,      Binary a) => Binary (F.VecList  n a)+deriving via ViaFixed (F.VecPeano n) a instance (ArityPeano n, Binary a) => Binary (F.VecPeano n a)  instance (Binary a) => Binary (F.Only a) where   put (F.Only a) = put a
fixed-vector-binary.cabal view
@@ -1,5 +1,5 @@ Name:           fixed-vector-binary-Version:        1.0.0.2+Version:        2.0.0.0 Synopsis:       Binary instances for fixed-vector Description:   This package contains Binary instances for data types defined in@@ -17,12 +17,13 @@   ChangeLog.md  tested-with:-    GHC ==7.10.3-     || ==8.0.2-     || ==8.2.2-     || ==8.4.4-     || ==8.6.5-     || ==8.8.1+    GHC ==8.10.7+     || ==9.0.1+     || ==9.2.8+     || ==9.4.7+     || ==9.6.6+     || ==9.8.2+     || ==9.10.1  source-repository head   type:     git@@ -31,22 +32,8 @@ Library   Ghc-options:          -Wall   Default-Language:     Haskell2010-  Build-Depends:        base         >=4.8 && <5-                      , fixed-vector >=1.0+  Build-Depends:        base         >=4.14 && <5+                      , fixed-vector >=2.0                       , binary   Exposed-modules:     Data.Vector.Fixed.Instances.Binary--Test-Suite test-  Ghc-options:      -Wall-  Default-Language: Haskell2010-  Type:           exitcode-stdio-1.0-  Hs-source-dirs: test-  Main-is:        QC.hs-  Build-Depends:-    base >=3 && <5,-    fixed-vector,-    fixed-vector-binary,-    binary,-    tasty,-    tasty-quickcheck
− test/QC.hs
@@ -1,74 +0,0 @@-{-# LANGUAGE DataKinds            #-}-{-# LANGUAGE FlexibleContexts     #-}-{-# LANGUAGE ScopedTypeVariables  #-}-{-# LANGUAGE TypeFamilies         #-}-{-# LANGUAGE UndecidableInstances #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}-import Test.Tasty-import Test.Tasty.QuickCheck as QC--import Data.Typeable-import Data.Binary-import qualified Data.Vector.Fixed           as F-import qualified Data.Vector.Fixed.Unboxed   as U-import qualified Data.Vector.Fixed.Boxed     as B-import qualified Data.Vector.Fixed.Storable  as S-import qualified Data.Vector.Fixed.Primitive as P-import           Data.Vector.Fixed.Instances.Binary ()---tests :: TestTree-tests = testGroup "cereal"-  [ testTagged p_serialize (T :: T (F.Only  Int))-  , testTagged p_serialize (T :: T (F.VecList 2 Int))-  , testTagged p_serialize (T :: T (F.VecList 3 Int))-  , testTagged p_serialize (T :: T (F.VecList 4 Int))-    ---  , testTagged p_serialize (T :: T (U.Vec 2 Int))-  , testTagged p_serialize (T :: T (U.Vec 3 Int))-  , testTagged p_serialize (T :: T (U.Vec 4 Int))-    ---  , testTagged p_serialize (T :: T (B.Vec 2 Int))-  , testTagged p_serialize (T :: T (B.Vec 3 Int))-  , testTagged p_serialize (T :: T (B.Vec 4 Int))-    ---  , testTagged p_serialize (T :: T (S.Vec 2 Int))-  , testTagged p_serialize (T :: T (S.Vec 3 Int))-  , testTagged p_serialize (T :: T (S.Vec 4 Int))-    ---  , testTagged p_serialize (T :: T (P.Vec 2 Int))-  , testTagged p_serialize (T :: T (P.Vec 3 Int))-  , testTagged p_serialize (T :: T (P.Vec 4 Int))-  ]--p_serialize :: (Binary a, Arbitrary a, Eq a) => T a -> a -> Bool-p_serialize _ a = a == (decode . encode) a--data T a = T--testTagged :: forall a b. (Testable b, Typeable a) => (T a -> b) -> T a -> TestTree-testTagged prop t-  = testProperty (show $ typeOf (undefined :: a)) (prop t)--main :: IO ()-main = defaultMain tests-------------------------------------------------------------------instance Arbitrary a => Arbitrary (F.Only a) where-  arbitrary = F.replicateM arbitrary-instance Arbitrary a => Arbitrary (F.Empty a) where-  arbitrary = F.replicateM arbitrary--instance (F.Arity n, Arbitrary a) => Arbitrary (F.VecList n a) where-  arbitrary = F.replicateM arbitrary-instance (U.Unbox n a, Arbitrary a) => Arbitrary (U.Vec n a) where-  arbitrary = F.replicateM arbitrary-instance (F.Arity n, Arbitrary a) => Arbitrary (B.Vec n a) where-  arbitrary = F.replicateM arbitrary-instance (F.Arity n, S.Storable a, Arbitrary a) => Arbitrary (S.Vec n a) where-  arbitrary = F.replicateM arbitrary-instance (F.Arity n, P.Prim a, Arbitrary a) => Arbitrary (P.Vec n a) where-  arbitrary = F.replicateM arbitrary---