vector-binary-instances 0.2 → 0.2.1.0
raw patch · 3 files changed
+25/−20 lines, 3 filesdep ~vectornew-uploader
Dependency ranges changed: vector
Files
- Data/Vector/Binary.hs +3/−3
- Data/Vector/Cereal.hs +3/−3
- vector-binary-instances.cabal +19/−14
Data/Vector/Binary.hs view
@@ -65,7 +65,7 @@ {-# INLINE get #-} ------------------------------------------------------------------------- + -- this is morally sound, if very awkward. -- all effects are contained, and can't escape the unsafeFreeze getGeneric :: (G.Vector v a, Binary a) => Get (v a)@@ -87,13 +87,13 @@ fill 0 lift $ G.unsafeFreeze mv- + -- | Generic put for anything in the G.Vector class. putGeneric :: (G.Vector v a, Binary a) => v a -> Put {-# INLINE putGeneric #-} putGeneric v = do put (G.length v)- mapM_ put (G.toList v)+ G.mapM_ put v lift :: IO b -> Get b lift = return .unsafePerformIO
Data/Vector/Cereal.hs view
@@ -50,7 +50,7 @@ {-# INLINE get #-} ------------------------------------------------------------------------- + -- this is morally sound, if very awkward. -- all effects are contained, and can't escape the unsafeFreeze getGeneric :: (G.Vector v a, Serialize a) => Get (v a)@@ -72,13 +72,13 @@ fill 0 lift $ G.unsafeFreeze mv- + -- | Generic put for anything in the G.Vector class. putGeneric :: (G.Vector v a, Serialize a) => v a -> Put {-# INLINE putGeneric #-} putGeneric v = do put (G.length v)- mapM_ put (G.toList v)+ G.mapM_ put v lift :: IO b -> Get b lift = return .unsafePerformIO
vector-binary-instances.cabal view
@@ -7,19 +7,19 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.2+Version: 0.2.1.0 -- A short (one-line) description of the package. Synopsis: Instances of Data.Binary and Data.Serialize for vector -- A longer description of the package.-Description: +Description: Instances for Binary for the types defined in the vector package, making it easy to serialize vectors to and from disk. We use the generic interface to vectors, so all vector types are supported. Specific instances are provided for unboxed, boxed and storable vectors.- . + . To serialize a vector: . > *Data.Vector.Binary> let v = Data.Vector.fromList [1..10]@@ -27,14 +27,15 @@ > fromList [1,2,3,4,5,6,7,8,9,10] :: Data.Vector.Vector > *Data.Vector.Binary> encode v > Chunk "\NUL\NUL\NUL\NUL\NUL...\NUL\NUL\NUL\t\NUL\NUL\NUL\NUL\n" Empty- . + . Which you can in turn compress before writing to disk: . > compress . encode $ v > Chunk "\US\139\b\NUL\NUL\N...\229\240,\254:\NUL\NUL\NUL" Empty- + -- URL for the project homepage or repository.-Homepage: http://code.haskell.org/~dons/code/binary-vector-instances+Homepage: https://github.com/bos/vector-binary-instances+bug-reports: https://github.com/bos/vector-binary-instances/issues -- The license under which the package is released. License: BSD3@@ -47,10 +48,10 @@ -- An email address to which users can send suggestions, bug reports, -- and patches.-Maintainer: dons00@gmail.com+Maintainer: dons00@gmail.com, bos@serpentine.com -- A copyright notice.--- Copyright: +-- Copyright: -- Stability of the pakcage (experimental, provisional, stable...) Stability: Experimental@@ -61,21 +62,25 @@ -- Extra files to be distributed with the package, such as examples or -- a README.--- Extra-source-files: +-- Extra-source-files: -- Constraint on the version of Cabal needed to build this package.-Cabal-version: >=1.2+Cabal-version: >=1.6 Library -- Modules exported by the library.- Exposed-modules: + Exposed-modules: Data.Vector.Binary, Data.Vector.Cereal- + -- Packages needed in order to build this package.- Build-depends: + Build-depends: base > 3 && < 6,- vector >= 0.5,+ vector >= 0.6, binary, cereal++source-repository head+ type: git+ location: https://github.com/bos/vector-binary-instances