-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Signed and unsigned LEB128 codec for binary library -- -- Signed and unsigned LEB128 codec for binary library. @package leb128-binary @version 0.1.3 -- | Unsigned LEB128 codec. This codec encodes an unsigned number -- as described here. -- -- 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 Signed LEB128 -- codec at Data.Binary.SLEB128 nor with the ZigZag LEB128 -- codec at Data.Binary.ZLEB128. module Data.Binary.ULEB128 -- | Newtype wrapper for Binary encoding and decoding x -- using the Unsigned LEB128 codec. Useful in conjunction with -- DerivingVia. newtype ULEB128 x ULEB128 :: x -> ULEB128 x putNatural :: Natural -> Put putWord64 :: Word64 -> Put putWord32 :: Word32 -> Put putWord16 :: Word16 -> Put putWord8 :: Word8 -> Put putWord :: Word -> Put getNatural :: Int -> Get Natural getWord64 :: Get Word64 getWord32 :: Get Word32 getWord16 :: Get Word16 getWord8 :: Get Word8 getWord :: Get Word getInteger :: Int -> Get Integer getInt64 :: Get Int64 getInt32 :: Get Int32 getInt16 :: Get Int16 getInt8 :: Get Int8 getInt :: Get Int -- | Puts a strict ByteString with its ULEB128-encoded length as -- prefix. -- -- See getByteString. putByteString :: ByteString -> Put -- | Gets a strict ByteString with its ULEB128-encoded length as -- prefix. -- -- See putByteString. getByteString :: Get ByteString -- | Puts a lazy ByteString with its ULEB128-encoded length as -- prefix. -- -- See getLazyByteString. putLazyByteString :: ByteString -> Put -- | Gets a lazy ByteString with its ULEB128-encoded length as -- prefix. -- -- See putLazyByteString. getLazyByteString :: Get ByteString -- | Puts a ShortByteString with its ULEB128-encoded length as -- prefix. -- -- See getShortByteString. putShortByteString :: ShortByteString -> Put -- | Gets a ShortByteString with its ULEB128-encoded length as -- prefix. -- -- See putShortByteString. getShortByteString :: Get ShortByteString -- | Puts a strict Text, UTF8-encoded with its ULEB128-encoded -- length as prefix. -- -- See getText. putText :: Text -> Put -- | Gets a strict Text, UTF8-encoded with its ULEB128-encoded -- length as prefix. -- -- See putText. getText :: Get Text -- | Puts a lazy Text, UTF8-encoded with its ULEB128-encoded length -- as prefix. -- -- See getLazyText. putLazyText :: Text -> Put -- | Gets a lazy Text, UTF8-encoded with its ULEB128-encoded length -- as prefix. -- -- See putLazyText. getLazyText :: Get Text -- | Elements of the list are prefixed with ULEB128-encoded length. Decode -- with getList. putList :: (a -> Put) -> [a] -> Put -- | Decodes a list encoded with putList. getList :: forall a. Get a -> Get [a] -- | Elements of the Seq are prefixed with ULEB128-encoded length. -- Decode with getSeq. putSeq :: (a -> Put) -> Seq a -> Put -- | Decodes a list encoded with putSeq. getSeq :: forall a. Get a -> Get (Seq a) -- | Elements of the Set are prefixed with ULEB128-encoded length. -- Decode with getSet. putSet :: (a -> Put) -> Set a -> Put -- | Decodes a list encoded with putSet. getSet :: forall a. Ord a => Get a -> Get (Set a) -- | Elements of the Map are prefixed with ULEB128-encoded length. -- Decode with getMap. putMap :: (k -> Put) -> (v -> Put) -> Map k v -> Put -- | Decodes a list encoded with putMap. getMap :: forall k v. Ord k => Get k -> Get v -> Get (Map k v) instance Data.Binary.ULEB128.DecodeOnly "getInt8" => Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Int.Int8) instance Data.Binary.ULEB128.DecodeOnly "getInt16" => Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Int.Int16) instance Data.Binary.ULEB128.DecodeOnly "getInt32" => Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Int.Int32) instance Data.Binary.ULEB128.DecodeOnly "getInt64" => Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Int.Int64) instance Data.Binary.ULEB128.DecodeOnly "getInt" => Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Types.Int) instance Data.Binary.ULEB128.DecodeOnly "getInteger" => Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Num.Integer.Integer) instance Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Num.Natural.Natural) instance Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Types.Word) instance Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Word.Word8) instance Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Word.Word16) instance Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Word.Word32) instance Data.Binary.Class.Binary (Data.Binary.ULEB128.ULEB128 GHC.Word.Word64) -- | Signed LEB128 codec. This codec encodes the two's complement of -- a signed number as described here. -- -- 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 ZigZag LEB128 -- codec at Data.Binary.ZLEB128. module Data.Binary.SLEB128 -- | Newtype wrapper for Binary encoding and decoding x -- using the Signed LEB128 codec. Useful in conjunction with -- DerivingVia. newtype SLEB128 x SLEB128 :: x -> SLEB128 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 -- | Compact Scientific encoding. Internally, it uses both ULEB128 -- and SLEB128. 0 is encoded as \x00, other numbers take at -- least two bytes. -- -- Compatible decoders are getFixed and getScientific. putScientific :: Scientific -> Put -- | Decode a Scientific encoded with putScientific or -- putFixed. getScientific :: Int -> Get Scientific -- | Compact Rational encoding. Internally, it uses both ULEB128 and -- SLEB128. Decode with getRational. 0 is encoded as -- \x00, other numbers take at least four bytes. putRational :: Rational -> Put -- | Decode a Rational encoded with putRational. getRational :: Int -> Get Rational -- | Same encoding as putScientific. -- -- Compatible decoders are getFixed and getScientific. putFixed :: HasResolution r => Fixed r -> Put -- | Decode a Fixed encoded with putFixed or -- putScientific. getFixed :: HasResolution r => Int -> Get (Fixed r) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Num.Integer.Integer) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Num.Natural.Natural) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Types.Int) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Types.Word) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Int.Int8) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Word.Word8) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Int.Int16) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Word.Word16) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Int.Int32) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Word.Word32) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Int.Int64) instance Data.Binary.Class.Binary (Data.Binary.SLEB128.SLEB128 GHC.Word.Word64) -- | 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. module Data.Binary.ZLEB128 -- | Newtype wrapper for Binary encoding and decoding x -- using the ZigZag LEB128 codec. Useful in conjunction with -- DerivingVia. newtype ZLEB128 x 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 instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Num.Integer.Integer) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Num.Natural.Natural) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Types.Int) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Types.Word) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Int.Int8) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Word.Word8) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Int.Int16) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Word.Word16) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Int.Int32) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Word.Word32) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Int.Int64) instance Data.Binary.Class.Binary (Data.Binary.ZLEB128.ZLEB128 GHC.Word.Word64)