cereal 0.4.1.0 → 0.4.1.1
raw patch · 2 files changed
+14/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- cereal.cabal +1/−1
- src/Data/Serialize.hs +13/−1
cereal.cabal view
@@ -1,5 +1,5 @@ name: cereal-version: 0.4.1.0+version: 0.4.1.1 license: BSD3 license-file: LICENSE author: Lennart Kolmodin <kolmodin@dtek.chalmers.se>,
src/Data/Serialize.hs view
@@ -255,6 +255,14 @@ ------------------------------------------------------------------------ +-- Safely wrap `chr` to avoid exceptions. +-- `chr` source: http://hackage.haskell.org/package/base-4.7.0.2/docs/src/GHC-Char.html#chr+chrEither :: Int -> Either String Char+chrEither i+ | i <= 0x10FFFF = Right (chr i) -- Or: C# (chr# i#)+ | otherwise =+ Left ("bad argument: " ++ show i)+ -- Char is serialised as UTF-8 instance Serialize Char where put a | c <= 0x7f = put (fromIntegral c :: Word8)@@ -296,7 +304,11 @@ z <- liftM (xor 0x80) getByte return (z .|. shiftL6 (y .|. shiftL6 (x .|. shiftL6 (xor 0xf0 w))))- return $! chr r+ case chrEither r of+ Right r' -> + return $! r'+ Left err ->+ fail err ------------------------------------------------------------------------ -- Instances for the first few tuples