| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Data.PackStream
Description
PackStream serialization: encode and decode Haskell values to/from the Neo4j PackStream binary format.
Synopsis
- pack :: PackStream a => a -> ByteString
- unpack :: PackStream a => ByteString -> Either Text a
- pack' :: PackStream a => a -> ByteString
- unpack' :: PackStream a => ByteString -> Either Text a
- lookupWithError :: PackStream v => Text -> HashMap Text Ps -> Text -> Result v
- fromOneField :: PackStream a => Vector Ps -> (a -> b) -> Text -> Result b
- lookupMaybe :: PackStream v => Text -> HashMap Text Ps -> Result (Maybe v)
- lookupMaybeError :: PackStream v => Text -> HashMap Text Ps -> Either Text v
- module Data.PackStream.Assoc
- module Data.PackStream.Get
- module Data.PackStream.Ps
- module Data.PackStream.Put
- module Data.PackStream.Result
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
module Data.PackStream.Assoc
module Data.PackStream.Get
module Data.PackStream.Ps
module Data.PackStream.Put
module Data.PackStream.Result