HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulepostgresql-binary-0.15.0.1Haskell2010

PostgreSQL.Binary.Decoding

  • 3 types
  • 58 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

9 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.15.0.1 · PostgreSQL.Binary.Decoding

Composite

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.

Range

Multirange