Safe Haskell | None |
---|---|
Language | Haskell2010 |
- parseResultsWith :: (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) -> Value -> Parser (Vector a)
- parseResultsWithDecoder :: Decoder a -> (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) -> Value -> Parser (Vector a)
- data Decoder a = Decoder {
- decodeEach :: Parser a -> Parser b
- decodeFold :: Parser (Vector b) -> Parser (Vector a)
- strictDecoder :: Decoder a
- lenientDecoder :: Decoder a
- getField :: Monad m => Text -> Vector Text -> Vector Value -> m Value
- getTag :: Monad m => Text -> HashMap Text Value -> m Value
- parseUTCTime :: Precision ty -> Value -> Parser UTCTime
- parsePOSIXTime :: Precision ty -> Value -> Parser POSIXTime
- parseRFC3339 :: ParseTime time => Value -> Parser time
- parseQueryField :: Value -> Parser QueryField
- parseResultsObject :: Value -> Parser (Vector Value)
- parseSeriesObject :: Value -> Parser (Vector Value)
- parseSeriesBody :: Value -> Parser (Maybe Text, HashMap Text Text, Vector Text, Array)
- parseErrorObject :: Value -> Parser a
Result parsers
:: (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) | A parser that takes
to construct a value. |
-> Value | |
-> Parser (Vector a) |
A helper function to parse a JSON response in
parseResults
.
parseResultsWithDecoder Source #
:: Decoder a | |
-> (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) | A parser that takes
to construct a value. |
-> Value | |
-> Parser (Vector a) |
Parse a JSON response with specified decoder settings.
Decoder settings
Decoder settings
Decoder | |
|
strictDecoder :: Decoder a Source #
Fail immediately if there's any parse failure.
lenientDecoder :: Decoder a Source #
Ignore parse failures and return successful results.
Getting fields and tags
Get a field value from a column name
Get a tag value from a tag name
Common JSON object parsers
parseUTCTime :: Precision ty -> Value -> Parser UTCTime Source #
Parse either a POSIX timestamp or RFC3339 formatted timestamp as UTCTime
.
parsePOSIXTime :: Precision ty -> Value -> Parser POSIXTime Source #
Parse either a POSIX timestamp or RFC3339 formatted timestamp as
POSIXTime
.
parseQueryField :: Value -> Parser QueryField Source #
Parse a QueryField
.
Utility functions
parseSeriesBody :: Value -> Parser (Maybe Text, HashMap Text Text, Vector Text, Array) Source #
Parse the common JSON structure used in query responses.
parseErrorObject :: Value -> Parser a Source #
Parse the common JSON structure used in failure response.