binary-list 1.0.0.1 → 1.0.1.0
raw patch · 2 files changed
+11/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.BinaryList.Serialize: decodedToList :: Decoded a -> [BinList a]
Files
- Data/BinaryList/Serialize.hs +10/−4
- binary-list.cabal +1/−1
Data/BinaryList/Serialize.hs view
@@ -14,6 +14,7 @@ , Decoded (..) , fromDecoded , toDecoded+ , decodedToList , decodeBinList -- ** ByteString translations , encodedToByteString@@ -108,8 +109,8 @@ deriving Show instance NFData a => NFData (Decoded a) where- rnf (PartialResult xs d) = rnf xs `seq` rnf d- rnf (FinalResult xs b) = rnf xs `seq` rnf b+ rnf (PartialResult xs d) = rnf xs `seq` rnf d+ rnf (FinalResult xs b) = rnf xs `seq` rnf b rnf (DecodingError str b) = rnf str `seq` rnf b -- | Get the final result of a decoding process, unless it returned an error, in which@@ -133,6 +134,12 @@ Right (l,_) -> go l $ PartialResult ys d _ -> PartialResult ys d +-- | Extract the list of binary lists from a 'Decoded' value.+decodedToList :: Decoded a -> [BinList a]+decodedToList (PartialResult xs d) = xs : decodedToList d+decodedToList (FinalResult xs _) = [xs]+decodedToList (DecodingError _ _) = []+ -- | Decode an encoded binary list. -- The result is given as a 'DecodedBinList' value, which can then be -- queried to get partial results.@@ -187,8 +194,7 @@ -- We start with 0 if the direction is left-to-right, and -- with 1 if the direction is right-to-left. putWord8 $ if d == FromLeft then 0 else 1- -- Exponent values are converted to Word64 (note that Word32 does not contain every Int in a- -- 64-bit system). Then the Word64 value is encoded in big-endian format.+ -- Exponent values are converted to Word64 for backwards compatibility. putWord64be $ fromIntegral l putLazyByteString b
binary-list.cabal view
@@ -1,5 +1,5 @@ name: binary-list-version: 1.0.0.1+version: 1.0.1.0 synopsis: Lists of length a power of two. description: Implementation of lists whose number of elements is a power of two. Binary lists have this property by definition,