packages feed

massiv-persist 0.1.0.0 → 1.0.0.0

raw patch · 6 files changed

+33/−41 lines, 6 filesdep ~basedep ~massivdep ~massiv-testPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, massiv, massiv-test

API changes (from Hackage documentation)

- Massiv.Persist: instance (Data.Massiv.Core.Index.Internal.Index ix, Control.DeepSeq.NFData e, Data.Persist.Persist e) => Data.Persist.Persist (Data.Massiv.Core.Common.Array Data.Massiv.Array.Manifest.Boxed.N ix e)
+ Massiv.Persist: instance (Data.Massiv.Core.Index.Internal.Index ix, Control.DeepSeq.NFData e, Data.Persist.Persist e) => Data.Persist.Persist (Data.Massiv.Core.Common.Array Data.Massiv.Array.Manifest.Boxed.BN ix e)
+ Massiv.Persist: instance (Data.Massiv.Core.Index.Internal.Index ix, Data.Persist.Persist e) => Data.Persist.Persist (Data.Massiv.Core.Common.Array Data.Massiv.Array.Manifest.Boxed.BL ix e)
- Massiv.Persist: getArray :: (Mutable r ix e, Persist e) => Get (Array r ix e)
+ Massiv.Persist: getArray :: (Mutable r e, Index ix, Persist e) => Get (Array r ix e)
- Massiv.Persist: putArray :: (Manifest r ix e, Persist e) => Array r ix e -> Put ()
+ Massiv.Persist: putArray :: (Manifest r e, Index ix, Persist e) => Array r ix e -> Put ()

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog for `massiv-persist` +## 1.0.0.0++* Switch to support `massiv-1.0.0.0`+ ## 0.1.0.0  * Initial release
massiv-persist.cabal view
@@ -1,5 +1,5 @@ name:                massiv-persist-version:             0.1.0.0+version:             1.0.0.0 synopsis:            Compatibility of 'massiv' with 'persist' description:         Orphan 'Persist' class instances from <https://hackage.haskell.org/package/persist persist> package that allow serialization of arrays defined in <https://hackage.haskell.org/package/massiv massiv> package homepage:            https://github.com/lehins/massiv-compat@@ -30,7 +30,7 @@   build-depends:       base >= 4.8 && < 5                      , bytestring                      , deepseq-                     , massiv >= 0.5.9.0+                     , massiv >= 1.0.0.0                      , persist                      , primitive @@ -50,7 +50,7 @@   build-tool-depends: hspec-discover:hspec-discover   build-depends:      base             >= 4.8 && < 5                     , massiv-persist-                    , massiv-test >= 0.1.5+                    , massiv-test >= 1.0.0                     , massiv                     , persist                     , hspec
src/Massiv/Persist.hs view
@@ -138,10 +138,7 @@   -- | Serialize array computation startegy and size-putArrayHeader ::-     forall r ix e. Manifest r ix e-  => Array r ix e-  -> Put ()+putArrayHeader :: forall r ix e. (Strategy r, Size r, Index ix) => Array r ix e -> Put () putArrayHeader arr = do   put (getComp arr)   put (size arr)@@ -150,10 +147,14 @@   put = putArray   get = getArray -instance (Index ix, NFData e, Persist e) => Persist (Array N ix e) where+instance (Index ix, Persist e) => Persist (Array BL ix e) where   put = putArray   get = getArray +instance (Index ix, NFData e, Persist e) => Persist (Array BN ix e) where+  put = putArray+  get = getArray+ instance (Index ix, Unbox e, Persist e) => Persist (Array U ix e) where   put = putArray   get = getArray@@ -161,7 +162,7 @@ -- | Serialize array as `LittleEndian` -- -- @since 0.1.0-putArray :: (Manifest r ix e, Persist e) => Array r ix e -> Put ()+putArray :: (Manifest r e, Index ix, Persist e) => Array r ix e -> Put () putArray arr = do   putArrayHeader arr   A.mapM_ put arr@@ -169,7 +170,7 @@ -- | Deserialize array from binary form in `LittleEndian` -- -- @since 0.1.0-getArray :: (Mutable r ix e, Persist e) => Get (Array r ix e)+getArray :: (Mutable r e, Index ix, Persist e) => Get (Array r ix e) getArray = do   comp <- get   sz <- get
tests/Main.hs view
@@ -1,6 +1,6 @@ module Main where -import Spec+import Spec (spec) import System.IO (BufferMode (LineBuffering), hSetBuffering, hSetEncoding, stdout, utf8) import Test.Hspec 
tests/Spec.hs view
@@ -1,1 +1,1 @@-{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --no-main #-}+{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-}
tests/Test/Massiv/PersistSpec.hs view
@@ -17,7 +17,8 @@  roundtripArray ::      forall r ix e.-     ( Mutable r ix e+     ( Mutable r e+     , Index ix      , Persist e      , Persist (Array r ix e)      , Eq (Array r ix e)@@ -37,10 +38,10 @@      forall r ix e.      ( Eq (Array r ix e)      , Show (Array r ix e)-     , Typeable ix      , Typeable e      , Arbitrary ix-     , Mutable r ix e+     , Load r ix e+     , Mutable r e      , Arbitrary e      , Persist e      , Persist (Array r ix e)@@ -66,21 +67,11 @@       prop "Sz5" $ roundtrip @Sz5     describe "Array" $ do       describe "P" $ do-        roundtripArraySpec @P @Ix1 @Word8-        roundtripArraySpec @P @Ix2 @Word8-        roundtripArraySpec @P @Ix3 @Word8-        roundtripArraySpec @P @Ix4 @Word8-        roundtripArraySpec @P @Ix5 @Word8         roundtripArraySpec @P @Ix1 @Word16         roundtripArraySpec @P @Ix2 @Word16         roundtripArraySpec @P @Ix3 @Word16         roundtripArraySpec @P @Ix4 @Word16         roundtripArraySpec @P @Ix5 @Word16-        roundtripArraySpec @P @Ix1 @Word32-        roundtripArraySpec @P @Ix2 @Word32-        roundtripArraySpec @P @Ix3 @Word32-        roundtripArraySpec @P @Ix4 @Word32-        roundtripArraySpec @P @Ix5 @Word32         roundtripArraySpec @P @Ix1 @Word64         roundtripArraySpec @P @Ix2 @Word64         roundtripArraySpec @P @Ix3 @Word64@@ -98,21 +89,11 @@         roundtripArraySpec @U @Ix4 @(Int, Word)         roundtripArraySpec @U @Ix5 @(Int, Word)       describe "S" $ do-        roundtripArraySpec @S @Ix1 @Word8-        roundtripArraySpec @S @Ix2 @Word8-        roundtripArraySpec @S @Ix3 @Word8-        roundtripArraySpec @S @Ix4 @Word8-        roundtripArraySpec @S @Ix5 @Word8         roundtripArraySpec @S @Ix1 @Word16         roundtripArraySpec @S @Ix2 @Word16         roundtripArraySpec @S @Ix3 @Word16         roundtripArraySpec @S @Ix4 @Word16         roundtripArraySpec @S @Ix5 @Word16-        roundtripArraySpec @S @Ix1 @Word32-        roundtripArraySpec @S @Ix2 @Word32-        roundtripArraySpec @S @Ix3 @Word32-        roundtripArraySpec @S @Ix4 @Word32-        roundtripArraySpec @S @Ix5 @Word32         roundtripArraySpec @S @Ix1 @Word64         roundtripArraySpec @S @Ix2 @Word64         roundtripArraySpec @S @Ix3 @Word64@@ -129,9 +110,15 @@         roundtripArraySpec @B @Ix3 @Integer         roundtripArraySpec @B @Ix4 @Integer         roundtripArraySpec @B @Ix5 @Integer-      describe "N" $ do-        roundtripArraySpec @N @Ix1 @Integer-        roundtripArraySpec @N @Ix2 @Integer-        roundtripArraySpec @N @Ix3 @Integer-        roundtripArraySpec @N @Ix4 @Integer-        roundtripArraySpec @N @Ix5 @Integer+      describe "BN" $ do+        roundtripArraySpec @BN @Ix1 @Integer+        roundtripArraySpec @BN @Ix2 @Integer+        roundtripArraySpec @BN @Ix3 @Integer+        roundtripArraySpec @BN @Ix4 @Integer+        roundtripArraySpec @BN @Ix5 @Integer+      describe "BL" $ do+        roundtripArraySpec @BL @Ix1 @Integer+        roundtripArraySpec @BL @Ix2 @Integer+        roundtripArraySpec @BL @Ix3 @Integer+        roundtripArraySpec @BL @Ix4 @Integer+        roundtripArraySpec @BL @Ix5 @Integer