packstream-bolt-0.1.0.0: PackStream binary serialization format
Safe HaskellNone
LanguageGHC2021

Data.PackStream.Tags

Description

Internal module. Not part of the public API.

Synopsis

Masks

pattern MASK_HIGH_NIBBLE :: (Eq a, Num a) => a Source #

Bitmask selecting the high nibble (upper 4 bits) of a byte.

pattern MASK_LOW_NIBBLE :: (Eq a, Num a) => a Source #

Bitmask selecting the low nibble (lower 4 bits) of a byte.

Null and Boolean

pattern TAG_Null :: (Eq a, Num a) => a Source #

Tag byte for Null (0xC0).

pattern TAG_false :: (Eq a, Num a) => a Source #

Tag byte for boolean false (0xC2).

pattern TAG_true :: (Eq a, Num a) => a Source #

Tag byte for boolean true (0xC3).

Integers

is_TAG_TINY_INT :: Word8 -> Bool Source #

Test whether tag is a TINY_INT

pattern TAG_INT_8 :: (Eq a, Num a) => a Source #

Tag byte for 8-bit signed integer (0xC8).

pattern TAG_INT_16 :: (Eq a, Num a) => a Source #

Tag byte for 16-bit signed integer (0xC9).

pattern TAG_INT_32 :: (Eq a, Num a) => a Source #

Tag byte for 32-bit signed integer (0xCA).

pattern TAG_INT_64 :: (Eq a, Num a) => a Source #

Tag byte for 64-bit signed integer (0xCB).

Float

pattern TAG_Float :: (Eq a, Num a) => a Source #

Tag byte for 64-bit float (0xC1).

Byte arrays

pattern TAG_BYTE_ARRAY_8 :: (Eq a, Num a) => a Source #

Tag byte for byte array with 8-bit length (0xCC).

pattern TAG_BYTE_ARRAY_16 :: (Eq a, Num a) => a Source #

Tag byte for byte array with 16-bit length (0xCD).

pattern TAG_BYTE_ARRAY_32 :: (Eq a, Num a) => a Source #

Tag byte for byte array with 32-bit length (0xCE).

Strings

pattern TAG_STRING_SHORT :: (Eq a, Num a) => a Source #

Base tag byte for short strings with length embedded in the low nibble (0x80).

is_TAG_STRING_SHORT :: Word8 -> Maybe Word32 Source #

Test whether tag is a short string; returns embedded length if so.

pattern TAG_STRING_8 :: (Eq a, Num a) => a Source #

Tag byte for string with 8-bit length (0xD0).

pattern TAG_STRING_16 :: (Eq a, Num a) => a Source #

Tag byte for string with 16-bit length (0xD1).

pattern TAG_STRING_32 :: (Eq a, Num a) => a Source #

Tag byte for string with 32-bit length (0xD3).

Lists

pattern TAG_LIST_SHORT :: (Eq a, Num a) => a Source #

Base tag byte for short lists with length embedded in the low nibble (0x90).

is_TAG_LIST_SHORT :: Word8 -> Maybe Word32 Source #

Test whether tag is a short list; returns embedded length if so.

pattern TAG_LIST_8 :: (Eq a, Num a) => a Source #

Tag byte for list with 8-bit length (0xD4).

pattern TAG_LIST_16 :: (Eq a, Num a) => a Source #

Tag byte for list with 16-bit length (0xD5).

pattern TAG_LIST_32 :: (Eq a, Num a) => a Source #

Tag byte for list with 32-bit length (0xD6).

Dictionaries

pattern TAG_DICTIONARY_SHORT :: (Eq a, Num a) => a Source #

Base tag byte for short dictionaries with length embedded in the low nibble (0xA0).

is_TAG_DICTIONARY_SHORT :: Word8 -> Maybe Word32 Source #

Test whether tag is a short dictionary; returns embedded length if so.

pattern TAG_DICTIONARY_8 :: (Eq a, Num a) => a Source #

Tag byte for dictionary with 8-bit length (0xD8).

pattern TAG_DICTIONARY_16 :: (Eq a, Num a) => a Source #

Tag byte for dictionary with 16-bit length (0xD9).

pattern TAG_DICTIONARY_32 :: (Eq a, Num a) => a Source #

Tag byte for dictionary with 32-bit length (0xDA).

Structures

is_TAG_STRUCTURE :: Word8 -> Maybe Word32 Source #

Test whether tag is a structure marker; returns the field count if so.