array package:hasql

Lift an Array decoder to a Value decoder.
Lift an array encoder into a value encoder.
A generic array decoder. Here's how you can use it to produce a specific array value decoder:
x :: Value [[Text]]
x = array (dimension replicateM (dimension replicateM (element (nonNullable text))))
Generic array encoder. Here's an example of its usage:
someParamsEncoder :: Params [[Int64]]
someParamsEncoder = param (nonNullable (array (dimension foldl' (dimension foldl' (element (nonNullable int8))))))
Please note that the PostgreSQL IN keyword does not accept an array, but rather a syntactical list of values, thus this encoder is not suited for that. Use a value = ANY($1) condition instead.
Lift a value decoder of element into a unidimensional array decoder producing a list. This function is merely a shortcut to the following expression:
(array . dimension Control.Monad.replicateM . element)
Please notice that in case of multidimensional arrays nesting listArray decoder won't work. You have to explicitly construct the array decoder using array.
Lift a value decoder of element into a unidimensional array decoder producing a generic vector. This function is merely a shortcut to the following expression:
(array . dimension Data.Vector.Generic.replicateM . element)
Please notice that in case of multidimensional arrays nesting vectorArray decoder won't work. You have to explicitly construct the array decoder using array.
Lift a value encoder of element into a unidimensional array encoder of a foldable value. This function is merely a shortcut to the following expression:
(array . dimension foldl' . element)
You can use it like this:
vectorOfInts :: Value (Vector Int64)
vectorOfInts = foldableArray (nonNullable int8)
Please notice that in case of multidimensional arrays nesting foldableArray encoder won't work. You have to explicitly construct the array encoder using array.