Copyright | (c) Andreas Klebinger 2020 |
---|---|
License | BSD3 |
Maintainer | Andreas Klebinger |
Portability | GHC >= 7.10 |
Safe Haskell | None |
Language | Haskell2010 |
SLEB128 is a synonym for the required constraints to encode values in the signed version of LEB128.
LEB128 is a typeclass which by default limits encoding in unsigned LEB128 format to GHC-Provided untyped valued.
UnsafeAnyLEB128 is a newtype providing an explicit way to avoid this restriction for cases where the type is signed, but values are not.
Synopsis
- class (Bits a, Integral a) => LEB128 a
- class (Bits a, Integral a) => SLEB128 a
- newtype UnsafeAnyLEB128 a = UnsafeAnyLEB128 a
Documentation
class (Bits a, Integral a) => LEB128 a Source #
Indicates that a type can safely be encoded as (unsigned) LEB128.
Instances
LEB128 Natural Source # | |
Defined in Codec.LEB128.Constraints | |
LEB128 Word Source # | |
Defined in Codec.LEB128.Constraints | |
LEB128 Word8 Source # | |
Defined in Codec.LEB128.Constraints | |
LEB128 Word16 Source # | |
Defined in Codec.LEB128.Constraints | |
LEB128 Word32 Source # | |
Defined in Codec.LEB128.Constraints | |
LEB128 Word64 Source # | |
Defined in Codec.LEB128.Constraints | |
(Bits a, Integral a) => LEB128 (UnsafeAnyLEB128 a) Source # | Unsafe escape hatch to force a particular encoding. |
Defined in Codec.LEB128.Constraints |
class (Bits a, Integral a) => SLEB128 a Source #
Indicates that a type can safely be encoded as (signed) SLEB128.
Instances
SLEB128 Int Source # | |
Defined in Codec.LEB128.Constraints | |
SLEB128 Int8 Source # | |
Defined in Codec.LEB128.Constraints | |
SLEB128 Int16 Source # | |
Defined in Codec.LEB128.Constraints | |
SLEB128 Int32 Source # | |
Defined in Codec.LEB128.Constraints | |
SLEB128 Int64 Source # | |
Defined in Codec.LEB128.Constraints | |
SLEB128 Integer Source # | |
Defined in Codec.LEB128.Constraints | |
(Bits a, Integral a) => SLEB128 (UnsafeAnyLEB128 a) Source # | Unsafe escape hatch to force a particular encoding. |
Defined in Codec.LEB128.Constraints |
newtype UnsafeAnyLEB128 a Source #