binary-bits 0.4 → 0.5
raw patch · 2 files changed
+14/−1 lines, 2 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Data.Binary.Bits.Put: instance Applicative BitPut
+ Data.Binary.Bits.Put: instance Functor BitPut
Files
- Data/Binary/Bits/Put.hs +13/−0
- binary-bits.cabal +1/−1
Data/Binary/Bits/Put.hs view
@@ -38,6 +38,7 @@ import Data.ByteString +import Control.Applicative import Data.Bits import Data.Monoid import Data.Word@@ -153,6 +154,18 @@ where PairS _ s = run m (S mempty 0 0) (S b _ _) = flushIncomplete s++instance Functor BitPut where+ fmap f (BitPut k) = BitPut $ \s ->+ let PairS x s' = k s+ in PairS (f x) s'++instance Applicative BitPut where+ pure a = BitPut (\s -> PairS a s)+ (BitPut f) <*> (BitPut g) = BitPut $ \s ->+ let PairS a s' = f s+ PairS b s'' = g s'+ in PairS (a b) s'' instance Monad BitPut where m >>= k = BitPut $ \s ->
binary-bits.cabal view
@@ -1,6 +1,6 @@ -- http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/ name: binary-bits-version: 0.4+version: 0.5 synopsis: Bit parsing/writing on top of binary. description: Bit parsing/writing on top of binary. Provides functions to read and write bits to and from 8\/16\/32\/64 words.