HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Primitive

Textual

valuetext_lazy :: Value LazyText

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

Misc

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

Exotic

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