packages feed

proto3-wire 1.2.2 → 1.3.0

raw patch · 8 files changed

+28/−22 lines, 8 filesdep +word-compatdep ~bytestringdep ~doctestdep ~ghc-primsetup-changednew-uploader

Dependencies added: word-compat

Dependency ranges changed: bytestring, doctest, ghc-prim, hashable

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+1.3.0+  - Support GHC 9.2+  - Prevent inlining for GHCJS+ 1.2.2   - Add new `zigZag{Encode,Decode}` utilities 
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
proto3-wire.cabal view
@@ -1,5 +1,5 @@ name:                proto3-wire-version:             1.2.2+version:             1.3.0 synopsis:            A low-level implementation of the Protocol Buffers (version 3) wire format license:             Apache-2.0 license-file:        LICENSE@@ -24,12 +24,12 @@   other-modules:       Proto3.Wire.Reverse.Internal                        Proto3.Wire.Reverse.Width   build-depends:       base >=4.12 && <=5.0,-                       bytestring >=0.10.6.0 && <0.11.0,+                       bytestring >=0.10.6.0 && <0.12.0,                        cereal >= 0.5.1 && <0.6,                        containers >=0.5 && < 0.7,                        deepseq ==1.4.*,-                       ghc-prim >=0.5.3 && <0.8,-                       hashable <1.4,+                       ghc-prim >=0.5.3 && <0.9,+                       hashable <1.5,                        parameterized >=0.5.0.0 && <1,                        primitive >=0.6.4 && <0.8,                        safe ==0.3.*,@@ -37,7 +37,8 @@                        transformers >=0.5.6.2 && <0.6,                        unordered-containers >= 0.1.0.0 && <0.3,                        vector >=0.12.0.2 && <0.13,-                       QuickCheck >=2.8 && <3.0+                       QuickCheck >=2.8 && <3.0,+                       word-compat >= 0.0.2 && <0.1    hs-source-dirs:      src   default-language:    Haskell2010@@ -55,7 +56,7 @@   build-depends:       base >=4.9 && <=5.0,                        bytestring >=0.10.6.0 && <0.11.0,                        cereal >= 0.5.1 && <0.6,-                       doctest >= 0.7.0 && <0.18,+                       doctest >= 0.7.0 && <0.21.0,                        proto3-wire,                        QuickCheck >=2.8 && <3.0,                        tasty >= 0.11 && <1.5,
src/Proto3/Wire/Decode.hs view
@@ -88,7 +88,6 @@ import           Data.Foldable           ( foldl' ) import qualified Data.IntMap.Strict      as M -- TODO intmap import           Data.Maybe              ( fromMaybe )-import           Data.Monoid             ( (<>) ) import           Data.Serialize.Get      ( Get, getWord8, getInt32le                                          , getInt64le, getWord32le, getWord64le                                          , runGet )
src/Proto3/Wire/Reverse/Internal.hs view
@@ -134,7 +134,11 @@ instance Monoid BuildR   where     mempty = BuildR (\v u s -> (# v, u, s #))+#ifdef ghcjs_HOST_OS+    {-# NOINLINE mempty #-}+#else     {-# INLINE mempty #-}+#endif      mappend = (<>)     {-# INLINE mappend #-}
src/Proto3/Wire/Reverse/Prim.hs view
@@ -107,9 +107,6 @@ import           Data.Int                      ( Int8, Int16, Int32, Int64 ) import           Data.Kind                     ( Type ) import qualified Data.Vector.Generic-import           Data.Word                     ( Word16,-                                                 byteSwap16, byteSwap32,-                                                 byteSwap64 ) import           Foreign                       ( Storable(..) ) import           GHC.Exts                      ( Addr#, Int#, Proxy#,                                                  RealWorld, State#, (+#),@@ -121,8 +118,7 @@ import           GHC.Ptr                       ( Ptr(..) ) import           GHC.TypeLits                  ( KnownNat, Nat,                                                  type (+), natVal' )-import           GHC.Word                      ( Word(..), Word8(..),-                                                 Word32(..), Word64(..) )+import           GHC.Word.Compat import           Parameterized.Data.Semigroup  ( PNullary, PSemigroup(..),                                                  (&<>) ) import           Parameterized.Data.Monoid     ( PMEmpty(..) )@@ -135,6 +131,10 @@  #include <MachDeps.h>  /* for WORDS_BIGENDIAN and WORD_SIZE_IN_BITS */ +#ifdef ghcjs_HOST_OS+import GHC.Exts (Word#)+#endif+ -- "ghc-prim" v0.6.1 defines `GHC.Prim.Ext.WORD64`, but we do not wish -- to require that version of "ghc-prim".  Therefore we define it locally. #if WORD_SIZE_IN_BITS < 64@@ -214,7 +214,11 @@ instance PMEmpty BoundedPrim 0   where     pmempty = BoundedPrim mempty+#ifdef ghcjs_HOST_OS+    {-# NOINLINE pmempty #-}+#else     {-# INLINE CONLIKE pmempty #-}+#endif  instance Max u v ~ w =>          PChoose BoundedPrim u v w
src/Proto3/Wire/Tutorial.hs view
@@ -167,7 +167,6 @@ module Proto3.Wire.Tutorial where  import           Data.ByteString         ( ByteString )-import           Data.Monoid             ( (<>) ) import           Data.Text.Lazy          ( Text ) import           Data.Word               ( Word64 ) 
test/Main.hs view
@@ -21,7 +21,7 @@  module Main where -import           Control.Arrow         ( (&&&), first, second )+import           Control.Arrow         ( (&&&), second ) import           Control.Monad         ( guard, void ) import           Control.Monad.Trans.State ( StateT(..) ) import qualified Data.Bits             as Bits@@ -30,7 +30,6 @@ import qualified Data.ByteString.Builder.Internal as BBI import           Data.Either           ( isLeft ) import           Data.Maybe            ( fromMaybe )-import           Data.Monoid           ( (<>) ) import           Data.Int import           Data.List             ( group ) import qualified Data.Text.Lazy        as T@@ -41,14 +40,12 @@ import           Proto3.Wire import qualified Proto3.Wire.Builder   as Builder import qualified Proto3.Wire.Reverse   as Reverse-import qualified Proto3.Wire.Reverse.Prim as Prim import qualified Proto3.Wire.Encode    as Encode import qualified Proto3.Wire.Decode    as Decode  import qualified Test.DocTest import           Test.QuickCheck       ( (===), Arbitrary ) import           Test.Tasty-import           Test.Tasty.HUnit      ( (@=?) ) import qualified Test.Tasty.HUnit      as HU import qualified Test.Tasty.QuickCheck as QC @@ -249,9 +246,9 @@  parseBytes :: Int64 -> StateT BL.ByteString Maybe BL.ByteString parseBytes n = StateT $ \bl -> do-  let (before, after) = BL.splitAt n bl-  guard (BL.length before == n)-  pure (before, after)+  let (prefix, suffix) = BL.splitAt n bl+  guard (BL.length prefix == n)+  pure (prefix, suffix)  -- | Parses a big-endian 64-bit unsigned integer. parseWord64BE :: StateT BL.ByteString Maybe Word64