packages feed

bytes 0.14.0.2 → 0.14.1

raw patch · 4 files changed

+24/−3 lines, 4 filesdep ~transformers-compatPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: transformers-compat

API changes (from Hackage documentation)

+ Data.Bytes.Get: instance MonadGet m => MonadGet (ExceptT e m)
+ Data.Bytes.Put: instance MonadPut m => MonadPut (ExceptT e m)

Files

.travis.yml view
@@ -9,7 +9,7 @@   - export PATH=~/.cabal/bin:$PATH   - cabal configure -flib-Werror $mode   - cabal install packdeps packunused-  - cabal build+  - cabal build --ghc-option=-ddump-minimal-imports  script:   - $script
bytes.cabal view
@@ -1,6 +1,6 @@ name:          bytes category:      Data, Serialization-version:       0.14.0.2+version:       0.14.1 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE@@ -53,7 +53,7 @@     text                      >= 0.2      && < 1.2,     time                      >= 1.2      && < 1.5,     transformers              >= 0.2      && < 0.5,-    transformers-compat       >= 0.1      && < 1,+    transformers-compat       >= 0.3      && < 1,     void                      >= 0.6      && < 0.7    if impl(ghc >= 7.4 && < 7.6)
src/Data/Bytes/Get.hs view
@@ -27,6 +27,7 @@  import Control.Applicative import Control.Monad.Reader+import Control.Monad.Trans.Except as Except import Control.Monad.RWS.Lazy as Lazy import Control.Monad.RWS.Strict as Strict import Control.Monad.State.Lazy as Lazy@@ -404,6 +405,24 @@     where     distribute (Left a, s', w') = Left (Left a, s', w')     distribute (Right b, s', w') = Right (Right b, s', w')+    factor = either id id+  {-# INLINE lookAheadE #-}++instance MonadGet m => MonadGet (ExceptT e m) where+  type Remaining (ExceptT e m) = Remaining m+  type Bytes (ExceptT e m) = Bytes m+  lookAhead = mapExceptT lookAhead+  {-# INLINE lookAhead #-}+  lookAheadM (ExceptT m) = ExceptT (liftM factor $ lookAheadE $ liftM distribute m)+    where+    distribute (Left e) = (Left (Left e))+    distribute (Right j) = (Right (Right j))+    factor = either id id+  {-# INLINE lookAheadM #-}+  lookAheadE (ExceptT m) = ExceptT (liftM factor $ lookAheadE $ liftM distribute m)+    where+    distribute (Left e) = (Left (Left e))+    distribute (Right a) = (Right (Right a))     factor = either id id   {-# INLINE lookAheadE #-} 
src/Data/Bytes/Put.hs view
@@ -29,6 +29,7 @@  import Control.Applicative import Control.Monad.Reader+import Control.Monad.Trans.Except as Except import Control.Monad.RWS.Lazy as Lazy import Control.Monad.RWS.Strict as Strict import Control.Monad.State.Lazy as Lazy@@ -240,6 +241,7 @@ instance (MonadPut m, Monoid w) => MonadPut (Strict.WriterT w m) instance (MonadPut m, Monoid w) => MonadPut (Lazy.RWST r w s m) instance (MonadPut m, Monoid w) => MonadPut (Strict.RWST r w s m)+instance (MonadPut m) => MonadPut (ExceptT e m) where  -- | Put a value into a lazy 'Lazy.ByteString' using 'B.runPut'. runPutL :: B.Put -> Lazy.ByteString