binary-strict 0.4.5 → 0.4.6
raw patch · 2 files changed
+12/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Binary.Strict.BitGet: lookAhead :: BitGet a -> BitGet a
Files
- binary-strict.cabal +2/−2
- src/Data/Binary/Strict/BitGet.hs +10/−0
binary-strict.cabal view
@@ -1,5 +1,5 @@ name: binary-strict-version: 0.4.5+version: 0.4.6 license: BSD3 license-file: LICENSE author: Lennart Kolmodin <kolmodin@dtek.chalmers.se>@@ -10,7 +10,7 @@ original source code. The binary team are currently unsure about their future plans w.r.t. strictness, so this is just a stop gap measure. See- http://www.haskell.org/haskellwiki/DealingWithBinaryData for+ <http://www.haskell.org/haskellwiki/DealingWithBinaryData> for documentation. synopsis: Binary deserialisation using strict ByteStrings category: Data, Parsing
src/Data/Binary/Strict/BitGet.hs view
@@ -31,6 +31,7 @@ , skip , remaining , isEmpty+ , lookAhead -- * Generic parsing , getBit@@ -95,6 +96,15 @@ put :: S -> BitGet () put s = BitGet (const (Right (), s))++-- | Run @ga@, but return without consuming its input.+-- Fails if @ga@ fails.+lookAhead :: BitGet a -> BitGet a+lookAhead g = do+ s <- get+ a <- g+ put s+ return a -- | Same as the standard splitAt, but in this version both parts share a byte -- so that splitting [1,2,3,4] at 2 results in ([1,2], [2, 3, 4]).