Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type WarningParser a = WriterT WarningParserMonoid Parser a
- data JSONWarning
- data WithJSONWarnings a = WithJSONWarnings a [JSONWarning]
- withObjectWarnings :: String -> (Object -> WarningParser a) -> Value -> Parser (WithJSONWarnings a)
- jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a
- jsonSubWarningsT :: Traversable t => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a)
- jsonSubWarningsTT :: (Traversable t, Traversable u) => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a))
- logJSONWarnings :: (MonadReader env m, HasLogFunc env, HasCallStack, MonadIO m) => FilePath -> [JSONWarning] -> m ()
- noJSONWarnings :: a -> WithJSONWarnings a
- tellJSONField :: Text -> WarningParser ()
- unWarningParser :: WarningParser a -> Parser a
- (.:) :: FromJSON a => Object -> Text -> Parser a
- (.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a)
- (..:) :: FromJSON a => Object -> Text -> WarningParser a
- (...:) :: FromJSON a => Object -> [Text] -> WarningParser a
- (..:?) :: FromJSON a => Object -> Text -> WarningParser (Maybe a)
- (...:?) :: FromJSON a => Object -> [Text] -> WarningParser (Maybe a)
- (..!=) :: WarningParser (Maybe a) -> a -> WarningParser a
Documentation
type WarningParser a = WriterT WarningParserMonoid Parser a Source #
A JSON parser that warns about unexpected fields in objects.
data JSONWarning Source #
Warning output from WarningParser
.
Instances
IsString JSONWarning Source # | |
Defined in Data.Aeson.WarningParser fromString :: String -> JSONWarning # | |
Show JSONWarning Source # | |
Defined in Data.Aeson.WarningParser showsPrec :: Int -> JSONWarning -> ShowS # show :: JSONWarning -> String # showList :: [JSONWarning] -> ShowS # | |
Eq JSONWarning Source # | |
Defined in Data.Aeson.WarningParser (==) :: JSONWarning -> JSONWarning -> Bool # (/=) :: JSONWarning -> JSONWarning -> Bool # | |
Display JSONWarning Source # | |
Defined in Data.Aeson.WarningParser display :: JSONWarning -> Utf8Builder # textDisplay :: JSONWarning -> Text # |
data WithJSONWarnings a Source #
Instances
withObjectWarnings :: String -> (Object -> WarningParser a) -> Value -> Parser (WithJSONWarnings a) Source #
WarningParser
version of withObject
.
jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a Source #
Handle warnings in a sub-object.
jsonSubWarningsT :: Traversable t => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a) Source #
Handle warnings in a Traversable
of sub-objects.
jsonSubWarningsTT :: (Traversable t, Traversable u) => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a)) Source #
Handle warnings in a Maybe Traversable
of sub-objects.
logJSONWarnings :: (MonadReader env m, HasLogFunc env, HasCallStack, MonadIO m) => FilePath -> [JSONWarning] -> m () Source #
Log JSON warnings.
noJSONWarnings :: a -> WithJSONWarnings a Source #
tellJSONField :: Text -> WarningParser () Source #
Tell the warning parser about an expected field, so it doesn't warn about it.
unWarningParser :: WarningParser a -> Parser a Source #
Convert a WarningParser
to a Parser
.
(.:) :: FromJSON a => Object -> Text -> Parser a Source #
Extends the .:
warning to include the field name that failed to parse.
(.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a) Source #
Extends the .:?
warning to include the field name that failed to parse.
(..:) :: FromJSON a => Object -> Text -> WarningParser a Source #
WarningParser
version of .:
.
(..:?) :: FromJSON a => Object -> Text -> WarningParser (Maybe a) Source #
WarningParser
version of .:?
.
(...:?) :: FromJSON a => Object -> [Text] -> WarningParser (Maybe a) Source #
Synonym version of ..:?
.
(..!=) :: WarningParser (Maybe a) -> a -> WarningParser a Source #
WarningParser
version of .!=
.