Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
ZigZag LEB128 codec. This codec encodes the ZigZag representation of a signed number through ULEB128.
Any getXXX decoder can decode bytes generated using any of the putXXX encoders, provided the encoded number fits in the target type.
WARNING: This is not compatible with the Unsigned LEB128 codec at Data.Binary.ULEB128 nor with the Signed LEB128 codec at Data.Binary.SLEB128.
Synopsis
- newtype ZLEB128 x = ZLEB128 x
- putInteger :: Integer -> Put
- putInt64 :: Int64 -> Put
- putInt32 :: Int32 -> Put
- putInt16 :: Int16 -> Put
- putInt8 :: Int8 -> Put
- putInt :: Int -> Put
- putNatural :: Natural -> Put
- putWord64 :: Word64 -> Put
- putWord32 :: Word32 -> Put
- putWord16 :: Word16 -> Put
- putWord8 :: Word8 -> Put
- putWord :: Word -> Put
- getInteger :: Int -> Get Integer
- getInt64 :: Get Int64
- getInt32 :: Get Int32
- getInt16 :: Get Int16
- getInt8 :: Get Int8
- getInt :: Get Int
- getNatural :: Int -> Get Natural
- getWord64 :: Get Word64
- getWord32 :: Get Word32
- getWord16 :: Get Word16
- getWord8 :: Get Word8
- getWord :: Get Word
Documentation
Newtype wrapper for Binary
encoding and decoding x
using the
ZigZag LEB128 codec. Useful in conjunction with DerivingVia
.
ZLEB128 x |
Instances
Binary (ZLEB128 Int16) Source # | |
Binary (ZLEB128 Int32) Source # | |
Binary (ZLEB128 Int64) Source # | |
Binary (ZLEB128 Int8) Source # | |
Binary (ZLEB128 Word16) Source # | |
Binary (ZLEB128 Word32) Source # | |
Binary (ZLEB128 Word64) Source # | |
Binary (ZLEB128 Word8) Source # | |
Binary (ZLEB128 Integer) Source # | Note: Maximum allowed number of input bytes is restricted to 1024.
Use |
Binary (ZLEB128 Natural) Source # | Note: Maximum allowed number of input bytes is restricted to 1024.
Use |
Binary (ZLEB128 Int) Source # | |
Binary (ZLEB128 Word) Source # | |
Put
putInteger :: Integer -> Put Source #
putNatural :: Natural -> Put Source #