Copyright | (c) Edward Kmett 2013 |
---|---|
License | BSD3 |
Maintainer | Edward Kmett <[email protected]> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.Bits.Coding
Description
Synopsis
- newtype Coding (m :: Type -> Type) a = Coding {}
- getAligned :: MonadGet m => m a -> Coding m a
- getBit :: forall (m :: Type -> Type). MonadGet m => Coding m Bool
- getBits :: forall (m :: Type -> Type) b. (MonadGet m, Bits b) => Int -> Int -> b -> Coding m b
- getBitsFrom :: forall (m :: Type -> Type) b. (MonadGet m, Bits b) => Int -> b -> Coding m b
- putAligned :: MonadPut m => m a -> Coding m a
- putUnaligned :: forall (m :: Type -> Type) b. (MonadPut m, FiniteBits b) => b -> Coding m ()
- putBit :: forall (m :: Type -> Type). MonadPut m => Bool -> Coding m ()
- putBits :: forall (m :: Type -> Type) b. (MonadPut m, Bits b) => Int -> Int -> b -> Coding m ()
- putBitsFrom :: forall (m :: Type -> Type) b. (MonadPut m, Bits b) => Int -> b -> Coding m ()
Documentation
newtype Coding (m :: Type -> Type) a Source #
Instances
Get
getAligned :: MonadGet m => m a -> Coding m a Source #
getBit :: forall (m :: Type -> Type). MonadGet m => Coding m Bool Source #
Get
a single bit, consuming an entire byte
if the bit buffer is empty
getBits :: forall (m :: Type -> Type) b. (MonadGet m, Bits b) => Int -> Int -> b -> Coding m b Source #
getBitsFrom :: forall (m :: Type -> Type) b. (MonadGet m, Bits b) => Int -> b -> Coding m b Source #
Put
putAligned :: MonadPut m => m a -> Coding m a Source #
putUnaligned :: forall (m :: Type -> Type) b. (MonadPut m, FiniteBits b) => b -> Coding m () Source #
Put
all the bits without a flush
putBit :: forall (m :: Type -> Type). MonadPut m => Bool -> Coding m () Source #
Put
a single bit, emitting an entire byte
if the bit buffer is full