Updated bytes patch

This commit is contained in:
Michael Snoyman 2013-09-02 11:35:44 +03:00
parent 8e8631641a
commit a462a8ba1f
2 changed files with 17 additions and 13 deletions

View File

@ -1,13 +0,0 @@
diff -ru orig/tests/doctests.hsc new/tests/doctests.hsc
--- orig/tests/doctests.hsc 2013-09-02 08:40:59.176527818 +0300
+++ new/tests/doctests.hsc 2013-09-02 08:40:59.000000000 +0300
@@ -59,7 +59,8 @@
: "-optPdist/build/autogen/cabal_macros.h"
: "-hide-all-packages"
: "-Iincludes"
- : map ("-package="++) deps ++ sources
+ : "dist/build/cbits/i2d.o"
+ : map ("-package="++) (filter (not . ("bytes-" `isPrefixOf`)) deps) ++ sources
getSources :: IO [FilePath]
getSources = filter (isSuffixOf ".hs") <$> go "src"

View File

@ -0,0 +1,17 @@
diff -ru orig/src/Data/Bytes/VarInt.hs new/src/Data/Bytes/VarInt.hs
--- orig/src/Data/Bytes/VarInt.hs 2013-09-02 11:35:18.532306195 +0300
+++ new/src/Data/Bytes/VarInt.hs 2013-09-02 11:35:18.000000000 +0300
@@ -36,9 +36,11 @@
-- | Integer/Word types serialized to base-128 variable-width ints.
--
--- >>> runPutL $ serialize (97 :: Word64)
+-- >>> import Data.Monoid (mconcat)
+-- >>> import Data.ByteString.Lazy (toChunks)
+-- >>> mconcat $ toChunks $ runPutL $ serialize (97 :: Word64)
-- "\NUL\NUL\NUL\NUL\NUL\NUL\NULa"
--- >>> runPutL $ serialize (97 :: VarInt Word64)
+-- >>> mconcat $ toChunks $ runPutL $ serialize (97 :: VarInt Word64)
-- "a"
newtype VarInt n = VarInt { unVarInt :: n }
deriving (Eq, Ord, Show, Enum, Num, Integral, Bounded, Real, Bits)