HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulepostgresql-binary-0.13.1.3Haskell2010

PostgreSQL.Binary.Decoding

  • 3 types
  • 39 values

Primitive

6 declarations
valuebytea_lazy :: Value LazyByteString
#

BYTEA or any other type in its undecoded form.

Textual

3 declarations
valuetext_strict :: Value Text
#

Any of the variable-length character types: BPCHAR, VARCHAR, NAME and TEXT.

valuetext_lazy :: Value LazyText
#

Any of the variable-length character types: BPCHAR, VARCHAR, NAME and TEXT.

Misc

8 declarations
valuejsonb_bytes :: (ByteString -> Either Text a) -> Value a
#

Given a function, which parses a plain UTF-8 JSON string encoded as a byte-array, produces a decoder.

For those wondering, yes, JSONB is encoded as plain JSON string in the binary format of Postgres. Sad, but true.

Time

11 declarations

Exotic

0 declarations

Array

newtypenewtype Array a
#

An efficient generic array decoder, which constructs the result value in place while parsing.

Here's how you can use it to produce a specific array value decoder:

x :: Value [ [ Text ] ]
x =
  array (dimensionArray replicateM (fmap catMaybes (dimensionArray replicateM (nullableValueArray text))))
Instances1Functor
  • Functor ArrayDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.Decoding

Composite

newtypenewtype Composite a
#
Instances4Monad, Functor, MonadFail, Applicative
  • Monad CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.Decoding
  • Functor CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.Decoding
  • MonadFail CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.Decoding
  • Applicative CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.Decoding

HStore

valuehstore
  1. :: forall (m :: Type -> Type). Monad m => Int -> m (k, Maybe v) -> m r
  2. -> Value k
  3. -> Value v
  4. -> Value r
#

A function for generic in place parsing of an HStore value.

Accepts:

  • An implementation of the replicateM function (Control.Monad.replicateM, Data.Vector.replicateM), which determines how to produce the final datastructure from the rows.

  • A decoder for keys.

  • A decoder for values.

Here's how you can use it to produce a parser to list:

hstoreAsList :: Value [ ( Text , Maybe Text ) ]
hstoreAsList =
  hstore replicateM text text
valueenum :: (Text -> Maybe a) -> Value a
#

Given a partial mapping from text to value, produces a decoder of that value.

valuerefine :: (a -> Either Text b) -> Value a -> Value b
#

Given additional constraints when using an existing value decoder, produces a decoder of that value.