bson 0.2.1 → 0.2.2
raw patch · 3 files changed
+7/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Bson.hs +1/−5
- Data/Bson/Binary.hs +5/−5
- bson.cabal +1/−1
Data/Bson.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE OverloadedStrings, TypeSynonymInstances, FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable, RankNTypes, OverlappingInstances #-} {-# LANGUAGE IncoherentInstances, ScopedTypeVariables #-}-{-# LANGUAGE ForeignFunctionInterface, BangPatterns, CPP #-}+{-# LANGUAGE ForeignFunctionInterface, BangPatterns #-} module Data.Bson ( -- * Document@@ -22,10 +22,6 @@ Regex(..), Javascript(..), Symbol(..), MongoStamp(..), MinMaxKey(..), -- ** ObjectId ObjectId(..), timestamp, genObjectId-#ifdef TEST- , composite- , roundTo-#endif ) where import Prelude hiding (lookup)
Data/Bson/Binary.hs view
@@ -13,7 +13,7 @@ import Control.Monad (when) import Data.Binary.Get (Get, runGet, getWord8, getWord32be, getWord64be, getWord32le, getWord64le, getLazyByteStringNul,- getLazyByteString, getByteString, isEmpty)+ getLazyByteString, getByteString, lookAhead) import Data.Binary.Put (Put, runPut, putWord8, putWord32le, putWord64le, putWord32be, putWord64be, putLazyByteString, putByteString)@@ -44,7 +44,7 @@ Array x -> putTL 0x04 >> putArray x Bin (Binary x) -> putTL 0x05 >> putBinary 0x00 x Fun (Function x) -> putTL 0x05 >> putBinary 0x01 x- Uuid (UUID x) -> putTL 0x05 >> putBinary 0x03 x+ Uuid (UUID x) -> putTL 0x05 >> putBinary 0x04 x Md5 (MD5 x) -> putTL 0x05 >> putBinary 0x05 x UserDef (UserDefined x) -> putTL 0x05 >> putBinary 0x80 x ObjId x -> putTL 0x07 >> putObjectId x@@ -79,6 +79,7 @@ 0x00 -> return $ Bin (Binary b) 0x01 -> return $ Fun (Function b) 0x03 -> return $ Uuid (UUID b)+ 0x04 -> return $ Uuid (UUID b) 0x05 -> return $ Md5 (MD5 b) 0x80 -> return $ UserDef (UserDefined b) _ -> fail $ "unknown Bson binary subtype " ++ show s@@ -148,12 +149,11 @@ getDocument :: Get Document getDocument = do- len <- subtract 5 <$> getInt32+ len <- subtract 4 <$> getInt32 b <- getLazyByteString (fromIntegral len)- getWord8 return (runGet getFields b) where- getFields = isEmpty >>= \done -> if done+ getFields = lookAhead getWord8 >>= \done -> if done == 0 then return [] else (:) <$> getField <*> getFields
bson.cabal view
@@ -1,5 +1,5 @@ Name: bson-Version: 0.2.1+Version: 0.2.2 Synopsis: BSON documents are JSON-like objects with a standard binary encoding. Description: A BSON Document is an untyped (dynamically type-checked) record.