Hello community, here is the log from the commit of package ghc-memory for openSUSE:Factory checked in at 2018-10-25 08:17:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-memory (Old) and /work/SRC/openSUSE:Factory/.ghc-memory.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-memory" Thu Oct 25 08:17:31 2018 rev:13 rq:642880 version:0.14.18 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-memory/ghc-memory.changes 2018-08-20 16:20:37.132923994 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-memory.new/ghc-memory.changes 2018-10-25 08:17:53.296030164 +0200 @@ -1,0 +2,13 @@ +Thu Oct 4 15:39:54 UTC 2018 - psim...@suse.com + +- Update memory to version 0.14.18. + ## 0.14.18 + + * Branch/Release Snafu + + ## 0.14.17 + + * Require basement >= 0.0.7, Fix compilation with GHC 8,6 + * Cleanup CPP, dropping support for much older version + +------------------------------------------------------------------- Old: ---- memory-0.14.16.tar.gz New: ---- memory-0.14.18.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-memory.spec ++++++ --- /var/tmp/diff_new_pack.DwDtuE/_old 2018-10-25 08:17:54.028029843 +0200 +++ /var/tmp/diff_new_pack.DwDtuE/_new 2018-10-25 08:17:54.028029843 +0200 @@ -12,14 +12,14 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global pkg_name memory %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.14.16 +Version: 0.14.18 Release: 0 Summary: Memory and related abstraction stuff License: BSD-3-Clause @@ -31,8 +31,10 @@ BuildRequires: ghc-basement-devel BuildRequires: ghc-bytestring-devel BuildRequires: ghc-deepseq-devel -BuildRequires: ghc-foundation-devel BuildRequires: ghc-rpm-macros +%if %{with tests} +BuildRequires: ghc-foundation-devel +%endif %description Chunk of memory, polymorphic byte array management and manipulation ++++++ memory-0.14.16.tar.gz -> memory-0.14.18.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/CHANGELOG.md new/memory-0.14.18/CHANGELOG.md --- old/memory-0.14.16/CHANGELOG.md 2018-02-27 07:36:10.000000000 +0100 +++ new/memory-0.14.18/CHANGELOG.md 2018-09-30 18:17:33.000000000 +0200 @@ -1,3 +1,12 @@ +## 0.14.18 + +* Branch/Release Snafu + +## 0.14.17 + +* Require basement >= 0.0.7, Fix compilation with GHC 8,6 +* Cleanup CPP, dropping support for much older version + ## 0.14.16 * Fix compilation with a newer basement (>= 0.0.7) and an older GHC (< 8.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/ByteArray/Encoding.hs new/memory-0.14.18/Data/ByteArray/Encoding.hs --- old/memory-0.14.16/Data/ByteArray/Encoding.hs 2018-02-27 07:18:24.000000000 +0100 +++ new/memory-0.14.18/Data/ByteArray/Encoding.hs 2018-09-10 10:06:25.000000000 +0200 @@ -5,7 +5,7 @@ -- Stability : experimental -- Portability : unknown -- --- ByteArray base converting +-- Base conversions for 'ByteArray'. -- module Data.ByteArray.Encoding ( convertToBase @@ -21,13 +21,35 @@ import Data.Memory.Encoding.Base32 import Data.Memory.Encoding.Base64 --- | Different bases that can be used +-- $setup +-- >>> :set -XOverloadedStrings +-- >>> import Data.ByteString + +-- | The different bases that can be used. -- -- See <http://tools.ietf.org/html/rfc4648 RFC4648> for details. -- In particular, Base64 can be standard or -- <http://tools.ietf.org/html/rfc4648#section-5 URL-safe>. URL-safe -- encoding is often used in other specifications without -- <http://tools.ietf.org/html/rfc4648#section-3.2 padding> characters. +-- +-- ==== Examples +-- +-- A quick example to show the differences: +-- +-- >>> let input = "Is 3 > 2?" :: ByteString +-- >>> let convertedTo base = convertToBase base input :: ByteString +-- >>> convertedTo Base16 +-- "49732033203e20323f" +-- >>> convertedTo Base32 +-- "JFZSAMZAHYQDEPY=" +-- >>> convertedTo Base64 +-- "SXMgMyA+IDI/" +-- >>> convertedTo Base64URLUnpadded +-- "SXMgMyA-IDI_" +-- >>> convertedTo Base64OpenBSD +-- "QVKeKw.8GBG9" +-- data Base = Base16 -- ^ similar to hexadecimal | Base32 | Base64 -- ^ standard Base64 @@ -35,7 +57,15 @@ | Base64OpenBSD -- ^ Base64 as used in OpenBSD password encoding (such as bcrypt) deriving (Show,Eq) --- | Convert a bytearray to the equivalent representation in a specific Base +-- | Encode some bytes to the equivalent representation in a specific 'Base'. +-- +-- ==== Examples +-- +-- Convert a 'ByteString' to base-64: +-- +-- >>> convertToBase Base64 ("foobar" :: ByteString) :: ByteString +-- "Zm9vYmFy" +-- convertToBase :: (ByteArrayAccess bin, ByteArray bout) => Base -> bin -> bout convertToBase base b = case base of Base16 -> doConvert (binLength * 2) toHexadecimal @@ -59,7 +89,20 @@ B.withByteArray b $ \bin -> f bout bin binLength --- | Try to Convert a bytearray from the equivalent representation in a specific Base +-- | Try to decode some bytes from the equivalent representation in a specific 'Base'. +-- +-- ==== Examples +-- +-- Successfully convert from base-64 to a 'ByteString': +-- +-- >>> convertFromBase Base64 ("Zm9vYmFy" :: ByteString) :: Either String ByteString +-- Right "foobar" +-- +-- Trying to decode invalid data will return an error string: +-- +-- >>> convertFromBase Base64 ("!!!" :: ByteString) :: Either String ByteString +-- Left "base64: input: invalid length" +-- convertFromBase :: (ByteArrayAccess bin, ByteArray bout) => Base -> bin -> Either String bout convertFromBase Base16 b | odd (B.length b) = Left "base16: input: invalid length" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/ByteArray/Methods.hs new/memory-0.14.18/Data/ByteArray/Methods.hs --- old/memory-0.14.16/Data/ByteArray/Methods.hs 2018-01-18 17:00:57.000000000 +0100 +++ new/memory-0.14.18/Data/ByteArray/Methods.hs 2018-09-30 18:16:37.000000000 +0200 @@ -26,6 +26,7 @@ , take , drop , span + , reverse , convert , copyRet , copyAndFreeze @@ -48,16 +49,14 @@ import Foreign.Storable import Foreign.Ptr -import Prelude hiding (length, take, drop, span, concat, replicate, splitAt, null, pred, last, any, all) +import Prelude hiding (length, take, drop, span, reverse, concat, replicate, splitAt, null, pred, last, any, all) import qualified Prelude -#if defined(WITH_BYTESTRING_SUPPORT) && defined(WITH_FOUNDATION_SUPPORT) +#if defined(WITH_BYTESTRING_SUPPORT) && defined(WITH_BASEMENT_SUPPORT) import qualified Data.ByteString as SPE (ByteString) import qualified Basement.UArray as SPE (UArray) -#if MIN_VERSION_basement(0,0,5) import qualified Basement.Block as SPE (Block) #endif -#endif -- | Allocate a new bytearray of specific size, and run the initializer on this memory alloc :: ByteArray ba => Int -> (Ptr p -> IO ()) -> IO ba @@ -197,6 +196,11 @@ | otherwise = i len = length bs +-- | Reverse a bytearray +reverse :: ByteArray bs => bs -> bs +reverse bs = unsafeCreate n $ \d -> withByteArray bs $ \s -> memReverse d s n + where n = length bs + -- | Concatenate bytearray into a larger bytearray concat :: (ByteArrayAccess bin, ByteArray bout) => [bin] -> bout concat l = unsafeCreate retLen (loopCopy l) @@ -205,7 +209,7 @@ loopCopy [] _ = return () loopCopy (x:xs) dst = do - withByteArray x $ \src -> memCopy dst src chunkLen + copyByteArrayToPtr x dst loopCopy xs (dst `plusPtr` chunkLen) where !chunkLen = length x @@ -218,14 +222,14 @@ copy :: (ByteArrayAccess bs1, ByteArray bs2) => bs1 -> (Ptr p -> IO ()) -> IO bs2 copy bs f = alloc (length bs) $ \d -> do - withByteArray bs $ \s -> memCopy d s (length bs) + copyByteArrayToPtr bs d f (castPtr d) -- | Similar to 'copy' but also provide a way to return a value from the initializer copyRet :: (ByteArrayAccess bs1, ByteArray bs2) => bs1 -> (Ptr p -> IO a) -> IO (a, bs2) copyRet bs f = allocRet (length bs) $ \d -> do - withByteArray bs $ \s -> memCopy d s (length bs) + copyByteArrayToPtr bs d f (castPtr d) -- | Similiar to 'copy' but expect the resulting bytearray in a pure context @@ -300,11 +304,9 @@ -- | Convert a bytearray to another type of bytearray convert :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout convert bs = inlineUnsafeCreate (length bs) (copyByteArrayToPtr bs) -#if defined(WITH_BYTESTRING_SUPPORT) && defined(WITH_FOUNDATION_SUPPORT) +#if defined(WITH_BYTESTRING_SUPPORT) && defined(WITH_BASEMENT_SUPPORT) {-# SPECIALIZE convert :: SPE.ByteString -> SPE.UArray Word8 #-} {-# SPECIALIZE convert :: SPE.UArray Word8 -> SPE.ByteString #-} -#if MIN_VERSION_basement(0,0,5) {-# SPECIALIZE convert :: SPE.ByteString -> SPE.Block Word8 #-} {-# SPECIALIZE convert :: SPE.Block Word8 -> SPE.ByteString #-} #endif -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/ByteArray/Sized.hs new/memory-0.14.18/Data/ByteArray/Sized.hs --- old/memory-0.14.16/Data/ByteArray/Sized.hs 2018-02-26 11:46:08.000000000 +0100 +++ new/memory-0.14.18/Data/ByteArray/Sized.hs 2018-09-30 12:47:52.000000000 +0200 @@ -21,6 +21,9 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} +#if __GLASGOW_HASKELL__ >= 806 +{-# LANGUAGE NoStarIsType #-} +#endif module Data.ByteArray.Sized ( ByteArrayN(..) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/ByteArray/Types.hs new/memory-0.14.18/Data/ByteArray/Types.hs --- old/memory-0.14.16/Data/ByteArray/Types.hs 2018-02-27 07:10:18.000000000 +0100 +++ new/memory-0.14.18/Data/ByteArray/Types.hs 2018-09-30 18:16:10.000000000 +0200 @@ -28,21 +28,7 @@ import Data.Memory.PtrMethods (memCopy) -#ifdef WITH_FOUNDATION_SUPPORT - -#if MIN_VERSION_foundation(0,0,14) && MIN_VERSION_basement(0,0,0) -# define NO_LEGACY_FOUNDATION_SUPPORT -#else -# define LEGACY_FOUNDATION_SUPPORT -#endif - -#if MIN_VERSION_basement(0,0,5) -# define SUPPORT_BLOCK -#endif - -#if MIN_VERSION_basement(0,0,7) && __GLASGOW_HASKELL__ >= 800 && defined(SUPPORT_BLOCK) -# define SUPPORT_BLOCKN -#endif +#ifdef WITH_BASEMENT_SUPPORT import Data.Proxy (Proxy(..)) import Data.Word (Word8) @@ -52,26 +38,12 @@ import qualified Basement.String as Base (String, toBytes, Encoding(UTF8)) import qualified Basement.PrimType as Base (primSizeInBytes) -#ifdef SUPPORT_BLOCK import qualified Basement.UArray.Mutable as BaseMutable (withMutablePtrHint) import qualified Basement.Block as Block import qualified Basement.Block.Mutable as Block -#endif -#ifdef SUPPORT_BLOCKN import Basement.Nat import qualified Basement.Sized.Block as BlockN -#endif - -#ifdef LEGACY_FOUNDATION_SUPPORT - -import qualified Foundation as F -import qualified Foundation.Collection as F -import qualified Foundation.String as F (toBytes, Encoding(UTF8)) -import qualified Foundation.Array.Internal as F -import qualified Foundation.Primitive as F (primSizeInBytes) - -#endif #endif @@ -108,9 +80,8 @@ return (r, Bytestring.PS fptr 0 sz) #endif -#ifdef WITH_FOUNDATION_SUPPORT +#ifdef WITH_BASEMENT_SUPPORT -#if MIN_VERSION_basement(0,0,5) baseBlockRecastW8 :: Base.PrimType ty => Block.Block ty -> Block.Block Word8 baseBlockRecastW8 = Block.unsafeCast -- safe with Word8 destination @@ -120,14 +91,11 @@ copyByteArrayToPtr ba dst = do mb <- Block.unsafeThaw (baseBlockRecastW8 ba) Block.copyToPtr mb 0 (castPtr dst) (Block.length $ baseBlockRecastW8 ba) -#endif -#ifdef SUPPORT_BLOCKN instance (KnownNat n, Base.PrimType ty, Base.Countable ty n) => ByteArrayAccess (BlockN.BlockN n ty) where length a = let Base.CountOf i = BlockN.lengthBytes a in i withByteArray a f = BlockN.withPtr a (f . castPtr) copyByteArrayToPtr bna = copyByteArrayToPtr (BlockN.toBlock bna) -#endif baseUarrayRecastW8 :: Base.PrimType ty => Base.UArray ty -> Base.UArray Word8 baseUarrayRecastW8 = Base.recast @@ -135,9 +103,7 @@ instance Base.PrimType ty => ByteArrayAccess (Base.UArray ty) where length a = let Base.CountOf i = Base.length (baseUarrayRecastW8 a) in i withByteArray a f = Base.withPtr (baseUarrayRecastW8 a) (f . castPtr) -#if MIN_VERSION_basement(0,0,5) copyByteArrayToPtr ba dst = Base.copyToPtr ba (castPtr dst) -#endif instance ByteArrayAccess Base.String where length str = let Base.CountOf i = Base.length bytes in i @@ -148,23 +114,17 @@ bytes = Base.toBytes Base.UTF8 str withByteArray s f = withByteArray (Base.toBytes Base.UTF8 s) f -#ifdef SUPPORT_BLOCK instance (Ord ty, Base.PrimType ty) => ByteArray (Block.Block ty) where allocRet sz f = do mba <- Block.new $ sizeRecastBytes sz Proxy a <- Block.withMutablePtrHint True False mba (f . castPtr) ba <- Block.unsafeFreeze mba return (a, ba) -#endif instance (Ord ty, Base.PrimType ty) => ByteArray (Base.UArray ty) where allocRet sz f = do mba <- Base.new $ sizeRecastBytes sz Proxy -#if MIN_VERSION_basement(0,0,5) a <- BaseMutable.withMutablePtrHint True False mba (f . castPtr) -#else - a <- Base.withMutablePtr mba (f . castPtr) -#endif ba <- Base.unsafeFreeze mba return (a, ba) @@ -175,56 +135,4 @@ where !(Base.CountOf szTy) = Base.primSizeInBytes p {-# INLINE [1] sizeRecastBytes #-} -#ifdef LEGACY_FOUNDATION_SUPPORT - -uarrayRecastW8 :: F.PrimType ty => F.UArray ty -> F.UArray Word8 -uarrayRecastW8 = F.recast - -instance F.PrimType ty => ByteArrayAccess (F.UArray ty) where -#if MIN_VERSION_foundation(0,0,10) - length a = let F.CountOf i = F.length (uarrayRecastW8 a) in i -#else - length = F.length . uarrayRecastW8 -#endif - withByteArray a f = F.withPtr (uarrayRecastW8 a) (f . castPtr) - -instance ByteArrayAccess F.String where -#if MIN_VERSION_foundation(0,0,10) - length str = let F.CountOf i = F.length bytes in i -#else - length str = F.length bytes -#endif - where - -- the Foundation's length return a number of elements not a number of - -- bytes. For @ByteArrayAccess@, because we are using an @Int@, we - -- didn't see that we were returning the wrong @CountOf@. - bytes = F.toBytes F.UTF8 str - withByteArray s f = withByteArray (F.toBytes F.UTF8 s) f - -instance (Ord ty, F.PrimType ty) => ByteArray (F.UArray ty) where - allocRet sz f = do - mba <- F.new $ sizeRecastBytes sz Proxy - a <- F.withMutablePtr mba (f . castPtr) - ba <- F.unsafeFreeze mba - return (a, ba) - where -#if MIN_VERSION_foundation(0,0,10) - sizeRecastBytes :: F.PrimType ty => Int -> Proxy ty -> F.CountOf ty - sizeRecastBytes w p = F.CountOf $ - let (q,r) = w `Prelude.quotRem` szTy - in q + (if r == 0 then 0 else 1) - where !(F.CountOf szTy) = F.primSizeInBytes p - {-# INLINE [1] sizeRecastBytes #-} -#else - sizeRecastBytes :: F.PrimType ty => Int -> Proxy ty -> F.Size ty - sizeRecastBytes w p = F.Size $ - let (q,r) = w `Prelude.quotRem` szTy - in q + (if r == 0 then 0 else 1) - where !(F.Size szTy) = F.primSizeInBytes p - {-# INLINE [1] sizeRecastBytes #-} -#endif - -#endif - - #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/Memory/Encoding/Base16.hs new/memory-0.14.18/Data/Memory/Encoding/Base16.hs --- old/memory-0.14.16/Data/Memory/Encoding/Base16.hs 2017-02-21 21:07:31.000000000 +0100 +++ new/memory-0.14.18/Data/Memory/Encoding/Base16.hs 2018-09-10 10:06:25.000000000 +0200 @@ -5,7 +5,10 @@ -- Stability : experimental -- Portability : unknown -- --- Hexadecimal escaper +-- Low-level Base16 encoding and decoding. +-- +-- If you just want to encode or decode some bytes, you probably want to use +-- the "Data.ByteArray.Encoding" module. -- {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/Memory/Encoding/Base32.hs new/memory-0.14.18/Data/Memory/Encoding/Base32.hs --- old/memory-0.14.16/Data/Memory/Encoding/Base32.hs 2018-01-23 15:20:48.000000000 +0100 +++ new/memory-0.14.18/Data/Memory/Encoding/Base32.hs 2018-09-10 10:06:25.000000000 +0200 @@ -5,7 +5,10 @@ -- Stability : experimental -- Portability : unknown -- --- Base32 +-- Low-level Base32 encoding and decoding. +-- +-- If you just want to encode or decode some bytes, you probably want to use +-- the "Data.ByteArray.Encoding" module. -- {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/Memory/Encoding/Base64.hs new/memory-0.14.18/Data/Memory/Encoding/Base64.hs --- old/memory-0.14.16/Data/Memory/Encoding/Base64.hs 2018-01-23 15:19:55.000000000 +0100 +++ new/memory-0.14.18/Data/Memory/Encoding/Base64.hs 2018-09-10 10:06:25.000000000 +0200 @@ -5,7 +5,10 @@ -- Stability : experimental -- Portability : unknown -- --- Base64 +-- Low-level Base64 encoding and decoding. +-- +-- If you just want to encode or decode some bytes, you probably want to use +-- the "Data.ByteArray.Encoding" module. -- {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/Data/Memory/PtrMethods.hs new/memory-0.14.18/Data/Memory/PtrMethods.hs --- old/memory-0.14.16/Data/Memory/PtrMethods.hs 2017-04-25 16:58:26.000000000 +0200 +++ new/memory-0.14.18/Data/Memory/PtrMethods.hs 2018-09-30 18:16:37.000000000 +0200 @@ -17,6 +17,7 @@ , memXorWith , memCopy , memSet + , memReverse , memEqual , memConstEqual , memCompare @@ -72,6 +73,14 @@ memSet start v n = c_memset start v (fromIntegral n) >>= \_ -> return () {-# INLINE memSet #-} +-- | Reverse a set number of bytes from @src@ to @dst@. Memory +-- locations should not overlap. +memReverse :: Ptr Word8 -> Ptr Word8 -> Int -> IO () +memReverse d s n + | n > 0 = do peekByteOff s (n - 1) >>= poke d + memReverse (d `plusPtr` 1) s (n - 1) + | otherwise = return () + -- | Check if two piece of memory are equals memEqual :: Ptr Word8 -> Ptr Word8 -> Int -> IO Bool memEqual p1 p2 n = loop 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/LICENSE new/memory-0.14.18/LICENSE --- old/memory-0.14.16/LICENSE 2017-02-21 21:07:31.000000000 +0100 +++ new/memory-0.14.18/LICENSE 2018-09-10 10:06:25.000000000 +0200 @@ -1,4 +1,5 @@ -Copyright (c) 2015 Vincent Hanquez <vinc...@snarc.org> +Copyright (c) 2015-2018 Vincent Hanquez <vinc...@snarc.org> +Copyright (c) 2017-2018 Nicolas Di Prima <nico...@primetype.co.uk> All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/README.md new/memory-0.14.18/README.md --- old/memory-0.14.16/README.md 2018-01-23 15:19:55.000000000 +0100 +++ new/memory-0.14.18/README.md 2018-09-10 10:06:25.000000000 +0200 @@ -37,24 +37,4 @@ Support ------- -Memory supports the following platform: - -* Windows >= 7 -* OSX >= 10.8 -* Linux - -On the following architectures: - -* x86-64 -* i386 - -On the following haskell versions: - -* GHC 7.10 -* GHC 8.0 -* GHC 8.2 - -Some older versions or different systems are possibly working too - - - +See [Haskell packages guidelines](https://github.com/vincenthz/haskell-pkg-guidelines/blob/master/README.md#support) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/memory.cabal new/memory-0.14.18/memory.cabal --- old/memory-0.14.16/memory.cabal 2018-02-27 07:34:54.000000000 +0100 +++ new/memory-0.14.18/memory.cabal 2018-09-30 18:17:38.000000000 +0200 @@ -1,5 +1,5 @@ Name: memory -version: 0.14.16 +version: 0.14.18 Synopsis: memory and related abstraction stuff Description: Chunk of memory, polymorphic byte array management and manipulation @@ -25,7 +25,7 @@ Build-Type: Simple Homepage: https://github.com/vincenthz/hs-memory Bug-Reports: https://github.com/vincenthz/hs-memory/issues -Cabal-Version: >=1.18 +cabal-version: 1.18 extra-doc-files: README.md CHANGELOG.md source-repository head @@ -38,6 +38,11 @@ Manual: True Flag support_foundation + Description: add support for foundation strings and unboxed array (deprecated use support_basement) + Default: True + Manual: True + +Flag support_basement Description: add support for foundation strings and unboxed array Default: True Manual: True @@ -75,7 +80,10 @@ Data.ByteArray.Methods Data.ByteArray.MemView Data.ByteArray.View - Build-depends: base >= 4 && < 5 + if impl(ghc < 8.0) + buildable: False + else + build-depends: base , ghc-prim -- FIXME armel or mispel is also little endian. -- might be a good idea to also add a runtime autodetect mode. @@ -94,12 +102,10 @@ if flag(support_deepseq) CPP-options: -DWITH_DEEPSEQ_SUPPORT Build-depends: deepseq >= 1.1 - if flag(support_foundation) - CPP-options: -DWITH_FOUNDATION_SUPPORT - Build-depends: basement, - foundation >= 0.0.8 - if impl(ghc >= 8.0) - Exposed-modules: Data.ByteArray.Sized + if flag(support_foundation) || flag(support_basement) + CPP-options: -DWITH_BASEMENT_SUPPORT + Build-depends: basement + exposed-modules: Data.ByteArray.Sized ghc-options: -Wall -fwarn-tabs default-language: Haskell2010 @@ -111,12 +117,23 @@ Other-modules: Imports SipHash Utils - Build-Depends: base >= 3 && < 5 + Build-Depends: base , bytestring , memory - , basement - , foundation >= 0.0.8 + , basement >= 0.0.7 + , foundation ghc-options: -Wall -fno-warn-orphans -fno-warn-missing-signatures -threaded default-language: Haskell2010 if flag(support_foundation) - CPP-options: -DWITH_FOUNDATION_SUPPORT + CPP-options: -DWITH_BASEMENT_SUPPORT + +-- Test-Suite test-examples +-- default-language: Haskell2010 +-- type: exitcode-stdio-1.0 +-- hs-source-dirs: tests +-- ghc-options: -threaded +-- Main-is: DocTests.hs +-- Build-Depends: base >= 3 && < 5 +-- , memory +-- , bytestring +-- , doctest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/tests/Tests.hs new/memory-0.14.18/tests/Tests.hs --- old/memory-0.14.16/tests/Tests.hs 2018-02-01 12:54:46.000000000 +0100 +++ new/memory-0.14.18/tests/Tests.hs 2018-09-30 18:16:37.000000000 +0200 @@ -19,11 +19,8 @@ import qualified SipHash -#ifdef WITH_FOUNDATION_SUPPORT -import qualified Foundation as F -#if MIN_VERSION_basement(0,0,5) +#ifdef WITH_BASEMENT_SUPPORT import Basement.Block (Block) -#endif import Basement.UArray (UArray) #endif @@ -33,7 +30,7 @@ arbitrary = Positive <$> between (0, 255) data Backend = BackendByte | BackendScrubbedBytes -#ifdef WITH_FOUNDATION_SUPPORT +#ifdef WITH_BASEMENT_SUPPORT #if MIN_VERSION_basement(0,0,5) | BackendBlock #endif @@ -52,7 +49,7 @@ case backend of BackendByte -> ArbitraryBS `fmap` ((B.pack `fmap` replicateM (fromIntegral n) arbitrary) :: Gen Bytes) BackendScrubbedBytes -> ArbitraryBS `fmap` ((B.pack `fmap` replicateM (fromIntegral n) arbitrary) :: Gen ScrubbedBytes) -#ifdef WITH_FOUNDATION_SUPPORT +#ifdef WITH_BASEMENT_SUPPORT #if MIN_VERSION_basement(0,0,5) BackendBlock -> ArbitraryBS `fmap` ((B.pack `fmap` replicateM (fromIntegral n) arbitrary) :: Gen (Block Word8)) #endif @@ -82,10 +79,8 @@ Group x [ Group "Bytes" (l withBytesWitness) , Group "ScrubbedBytes" (l withScrubbedBytesWitness) -#ifdef WITH_FOUNDATION_SUPPORT -#if MIN_VERSION_basement(0,0,5) +#ifdef WITH_BASEMENT_SUPPORT , Group "Block" (l withBlockWitness) -#endif , Group "UArray" (l withUArrayWitness) #endif ] @@ -222,7 +217,7 @@ ] , testShowProperty "showing" $ \witnessID expectedShow (Words8 l) -> (show . witnessID . B.pack $ l) == expectedShow l -#ifdef WITH_FOUNDATION_SUPPORT +#ifdef WITH_BASEMENT_SUPPORT , testFoundationTypes #endif ] @@ -251,11 +246,12 @@ let chunks = fmap (witnessID . B.pack . unWords8) l expected = concatMap unWords8 l in B.pack expected == witnessID (B.concat chunks) - , Property "cons b bs == reverse (snoc (reverse bs) b)" $ \(Words8 l) b -> - let b1 = witnessID (B.pack l) - b2 = witnessID (B.pack (reverse l)) - expected = B.pack (reverse (B.unpack (B.snoc b2 b))) - in B.cons b b1 == expected + , Property "reverse" $ \(Words8 l) -> + let b = witnessID (B.pack l) + in reverse l == B.unpack (B.reverse b) + , Property "cons b (reverse bs) == reverse (snoc bs b)" $ \(Words8 l) b -> + let a = witnessID (B.pack l) + in B.cons b (B.reverse a) == B.reverse (B.snoc a b) , Property "all == Prelude.all" $ \(Words8 l) b -> let b1 = witnessID (B.pack l) p = (/= b) @@ -278,19 +274,19 @@ in B.span (const False) b == (B.empty, b) ] -#ifdef WITH_FOUNDATION_SUPPORT -testFoundationTypes = Group "Foundation" - [ CheckPlan "allocRet 4 _ :: F.UArray Int8 === 4" $ do - x <- pick "allocateRet 4 _" $ (B.length :: F.UArray F.Int8 -> Int) . snd <$> B.allocRet 4 (const $ return ()) +#ifdef WITH_BASEMENT_SUPPORT +testFoundationTypes = Group "Basement" + [ CheckPlan "allocRet 4 _ :: UArray Int8 === 4" $ do + x <- pick "allocateRet 4 _" $ (B.length :: UArray Int8 -> Int) . snd <$> B.allocRet 4 (const $ return ()) validate "4 === x" $ x === 4 - , CheckPlan "allocRet 4 _ :: F.UArray Int16 === 4" $ do - x <- pick "allocateRet 4 _" $ (B.length :: F.UArray F.Int16 -> Int) . snd <$> B.allocRet 4 (const $ return ()) + , CheckPlan "allocRet 4 _ :: UArray Int16 === 4" $ do + x <- pick "allocateRet 4 _" $ (B.length :: UArray Int16 -> Int) . snd <$> B.allocRet 4 (const $ return ()) validate "4 === x" $ x === 4 - , CheckPlan "allocRet 4 _ :: F.UArray Int32 === 4" $ do - x <- pick "allocateRet 4 _" $ (B.length :: F.UArray F.Int32 -> Int) . snd <$> B.allocRet 4 (const $ return ()) + , CheckPlan "allocRet 4 _ :: UArray Int32 === 4" $ do + x <- pick "allocateRet 4 _" $ (B.length :: UArray Int32 -> Int) . snd <$> B.allocRet 4 (const $ return ()) validate "4 === x" $ x === 4 - , CheckPlan "allocRet 4 _ :: F.UArray Int64 === 8" $ do - x <- pick "allocateRet 4 _" $ (B.length :: F.UArray F.Int64 -> Int) . snd <$> B.allocRet 4 (const $ return ()) + , CheckPlan "allocRet 4 _ :: UArray Int64 === 8" $ do + x <- pick "allocateRet 4 _" $ (B.length :: UArray Int64 -> Int) . snd <$> B.allocRet 4 (const $ return ()) validate "8 === x" $ x === 8 ] #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.14.16/tests/Utils.hs new/memory-0.14.18/tests/Utils.hs --- old/memory-0.14.16/tests/Utils.hs 2018-01-18 15:51:46.000000000 +0100 +++ new/memory-0.14.18/tests/Utils.hs 2018-09-30 18:16:10.000000000 +0200 @@ -4,8 +4,7 @@ import Data.Word import Data.ByteArray (Bytes, ScrubbedBytes) -#ifdef WITH_FOUNDATION_SUPPORT -import qualified Foundation as F +#ifdef WITH_BASEMENT_SUPPORT import Basement.Block (Block) import Basement.UArray (UArray) #endif @@ -28,7 +27,7 @@ withScrubbedBytesWitness :: ScrubbedBytes -> ScrubbedBytes withScrubbedBytesWitness = id -#ifdef WITH_FOUNDATION_SUPPORT +#ifdef WITH_BASEMENT_SUPPORT withBlockWitness :: Block Word8 -> Block Word8 withBlockWitness = withWitness (Witness :: Witness (Block Word8)) ++++++ memory.cabal ++++++ --- /var/tmp/diff_new_pack.DwDtuE/_old 2018-10-25 08:17:54.124029801 +0200 +++ /var/tmp/diff_new_pack.DwDtuE/_new 2018-10-25 08:17:54.124029801 +0200 @@ -1,5 +1,5 @@ Name: memory -version: 0.14.16 +version: 0.14.18 x-revision: 1 Synopsis: memory and related abstraction stuff Description: @@ -26,7 +26,7 @@ Build-Type: Simple Homepage: https://github.com/vincenthz/hs-memory Bug-Reports: https://github.com/vincenthz/hs-memory/issues -Cabal-Version: >=1.18 +cabal-version: 1.18 extra-doc-files: README.md CHANGELOG.md source-repository head @@ -39,6 +39,11 @@ Manual: True Flag support_foundation + Description: add support for foundation strings and unboxed array (deprecated use support_basement) + Default: True + Manual: True + +Flag support_basement Description: add support for foundation strings and unboxed array Default: True Manual: True @@ -76,7 +81,10 @@ Data.ByteArray.Methods Data.ByteArray.MemView Data.ByteArray.View - Build-depends: base >= 4 && < 4.12 + if impl(ghc < 8.0) + build-depends: base >= 4.9.0.0 && < 4.13 + else + build-depends: base >= 4.9.0.0 && < 5 , ghc-prim -- FIXME armel or mispel is also little endian. -- might be a good idea to also add a runtime autodetect mode. @@ -95,12 +103,10 @@ if flag(support_deepseq) CPP-options: -DWITH_DEEPSEQ_SUPPORT Build-depends: deepseq >= 1.1 - if flag(support_foundation) - CPP-options: -DWITH_FOUNDATION_SUPPORT - Build-depends: basement, - foundation >= 0.0.8 - if impl(ghc >= 8.0) - Exposed-modules: Data.ByteArray.Sized + if flag(support_foundation) || flag(support_basement) + CPP-options: -DWITH_BASEMENT_SUPPORT + Build-depends: basement + exposed-modules: Data.ByteArray.Sized ghc-options: -Wall -fwarn-tabs default-language: Haskell2010 @@ -112,12 +118,23 @@ Other-modules: Imports SipHash Utils - Build-Depends: base >= 3 && < 5 + Build-Depends: base , bytestring , memory - , basement - , foundation >= 0.0.8 + , basement >= 0.0.7 + , foundation ghc-options: -Wall -fno-warn-orphans -fno-warn-missing-signatures -threaded default-language: Haskell2010 if flag(support_foundation) - CPP-options: -DWITH_FOUNDATION_SUPPORT + CPP-options: -DWITH_BASEMENT_SUPPORT + +-- Test-Suite test-examples +-- default-language: Haskell2010 +-- type: exitcode-stdio-1.0 +-- hs-source-dirs: tests +-- ghc-options: -threaded +-- Main-is: DocTests.hs +-- Build-Depends: base >= 3 && < 5 +-- , memory +-- , bytestring +-- , doctest