| Copyright | (c) Edward Kmett 2013 |
|---|---|
| License | BSD3 |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell98 |
Data.Bits.Coding
Description
- newtype Coding m a = Coding {}
- getAligned :: MonadGet m => m a -> Coding m a
- getBit :: MonadGet m => Coding m Bool
- getBits :: (MonadGet m, Bits b) => Int -> Int -> b -> Coding m b
- getBitsFrom :: (MonadGet m, Bits b) => Int -> b -> Coding m b
- putAligned :: MonadPut m => m a -> Coding m a
- putUnaligned :: (MonadPut m, FiniteBits b) => b -> Coding m ()
- putBit :: MonadPut m => Bool -> Coding m ()
- putBits :: (MonadPut m, Bits b) => Int -> Int -> b -> Coding m ()
- putBitsFrom :: (MonadPut m, Bits b) => Int -> b -> Coding m ()
Documentation
Instances
| MonadTrans Coding | |
| MonadReader e m => MonadReader e (Coding m) | |
| MonadState s m => MonadState s (Coding m) | |
| (Monad m, Alternative m) => Alternative (Coding m) | |
| Monad m => Monad (Coding m) | |
| Functor (Coding m) | |
| MonadPlus m => MonadPlus (Coding m) | |
| Monad m => Applicative (Coding m) | |
| MonadGet m => MonadGet (Coding m) | |
| MonadPut m => MonadPut (Coding m) | |
| type Bytes (Coding m) = Bytes m | |
| type Remaining (Coding m) = Remaining m |
Get
getAligned :: MonadGet m => m a -> Coding m a Source
getBit :: MonadGet m => Coding m Bool Source
Get a single bit, consuming an entire byte if the bit buffer is empty
Put
putAligned :: MonadPut m => m a -> Coding m a Source
putUnaligned :: (MonadPut m, FiniteBits b) => b -> Coding m () Source
Put all the bits without a flush
putBit :: MonadPut m => Bool -> Coding m () Source
Put a single bit, emitting an entire byte if the bit buffer is full