License | BSD3 |
---|---|
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
Unaligned codes
encode :: MonadPut m => c -> Coding m () Source #
encodeMany :: (MonadPut m, Foldable t) => t c -> Coding m () Source #
Unary-coded integers
>>>
runPutL . runEncode $ encode (Unary 1) >> flush
"\128">>>
runPutL . runEncode $ encode (Unary 7) >> flush
"\254"
Instances
Enum n => Enum (Unary n) Source # | |
Eq n => Eq (Unary n) Source # | |
Integral n => Integral (Unary n) Source # | |
Defined in Data.Bits.Coded | |
Num n => Num (Unary n) Source # | |
Ord n => Ord (Unary n) Source # | |
Read n => Read (Unary n) Source # | |
Real n => Real (Unary n) Source # | |
Defined in Data.Bits.Coded toRational :: Unary n -> Rational # | |
Show n => Show (Unary n) Source # | |
Integral n => Coded (Unary n) Source # | |
Representation for Elias Gamma
and Delta
codes. A positive
integer n
is encoded by encoding the position of its most
significant bit, and then the binary representation of the rest of
the number.
Instances
Enum n => Enum (Elias c n) Source # | |
Defined in Data.Bits.Coded succ :: Elias c n -> Elias c n # pred :: Elias c n -> Elias c n # fromEnum :: Elias c n -> Int # enumFrom :: Elias c n -> [Elias c n] # enumFromThen :: Elias c n -> Elias c n -> [Elias c n] # enumFromTo :: Elias c n -> Elias c n -> [Elias c n] # enumFromThenTo :: Elias c n -> Elias c n -> Elias c n -> [Elias c n] # | |
Eq n => Eq (Elias c n) Source # | |
Integral n => Integral (Elias c n) Source # | |
Defined in Data.Bits.Coded | |
Num n => Num (Elias c n) Source # | |
Ord n => Ord (Elias c n) Source # | |
Defined in Data.Bits.Coded | |
Read n => Read (Elias c n) Source # | |
Real n => Real (Elias c n) Source # | |
Defined in Data.Bits.Coded toRational :: Elias c n -> Rational # | |
Show n => Show (Elias c n) Source # | |
(Coded c, Integral c, Ranked n) => Coded (Elias c n) Source # | |
Defined in Data.Bits.Coded |
type Gamma c = Elias (Unary c) Source #
Elias Gamma codes the position of the most significant in
Unary
.