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

Data.PackStream

Description

PackStream serialization: encode and decode Haskell values to/from the Neo4j PackStream binary format.

Synopsis

Simple interface to pack and unpack msgpack binary

Lazy ByteString

pack :: PackStream a => a -> ByteString Source #

Pack a Haskell value to PackStream binary.

unpack :: PackStream a => ByteString -> Either Text a Source #

Unpack PackStream binary to a Haskell value. If it fails, it returns Left with an error message.

Strict ByteString

pack' :: PackStream a => a -> ByteString Source #

Variant of pack serializing to a strict ByteString

unpack' :: PackStream a => ByteString -> Either Text a Source #

Variant of unpack serializing to a strict ByteString

lookupWithError :: PackStream v => Text -> HashMap Text Ps -> Text -> Result v Source #

Look up a key in a dictionary, returning a custom error if absent.

fromOneField :: PackStream a => Vector Ps -> (a -> b) -> Text -> Result b Source #

Decode a single-field structure vector, applying the constructor on success.

lookupMaybe :: PackStream v => Text -> HashMap Text Ps -> Result (Maybe v) Source #

Look up an optional key in a dictionary, returning Nothing if absent.

lookupMaybeError :: PackStream v => Text -> HashMap Text Ps -> Either Text v Source #

Look up a required key in a dictionary, returning Left with an error if absent.

Re-export modules