cereal-enumerator 0.1 → 0.2
raw patch · 2 files changed
+11/−8 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
Data/Serialize/Get/Enumerator.hs view
@@ -4,13 +4,14 @@ , iterGet ) where +import Prelude as P import Control.Exception import Data.Monoid import Data.Typeable import Data.Serialize.Get import Data.Enumerator-import Data.ByteString+import Data.ByteString as BS data ParseError = ParseError String | EOFError@@ -18,8 +19,8 @@ instance Exception ParseError ---- | Convert a 'Get' to an 'Iteratee'. A 'ParseError' is emitted on failure.+-- | Convert a 'Get' to an 'Iteratee'. The resulting 'Iteratee' emits a+-- 'ParseError' on failure. iterGet :: Monad m => Get a -> Iteratee ByteString m a iterGet = continue . step . runGetPartial where@@ -30,7 +31,9 @@ Fail s -> throwError (ParseError s) loop p [] = continue (step p)- loop p (x:xs) = case p x of- Done r bs -> yield r $ Chunks (bs:xs)- Partial c -> loop c xs- Fail s -> throwError (ParseError s)+ loop p (x:xs)+ | BS.null x = loop p xs+ | otherwise = case p x of+ Done r bs -> yield r $ Chunks (bs:xs)+ Partial c -> loop c xs+ Fail s -> throwError (ParseError s)
cereal-enumerator.cabal view
@@ -1,5 +1,5 @@ name: cereal-enumerator-version: 0.1+version: 0.2 synopsis: Deserialize things with cereal and enumerator license: PublicDomain author: Patrick Palka