stack-1.4.0: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Data.Aeson.Extended

Contents

Description

Extensions to Aeson parsing of objects.

Synopsis

Extended failure messages

(.:) :: FromJSON a => Object -> Text -> Parser a #

Extends .: warning to include field name.

(.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a) #

Extends .:? warning to include field name.

JSON Parser that emits warnings

type WarningParser a = WriterT WarningParserMonoid Parser a #

JSON parser that warns about unexpected fields in objects.

data WithJSONWarnings a #

Constructors

WithJSONWarnings a [JSONWarning] 

Instances

Functor WithJSONWarnings # 

Methods

fmap :: (a -> b) -> WithJSONWarnings a -> WithJSONWarnings b #

(<$) :: a -> WithJSONWarnings b -> WithJSONWarnings a #

Generic (WithJSONWarnings a) # 

Associated Types

type Rep (WithJSONWarnings a) :: * -> * #

Monoid a => Monoid (WithJSONWarnings a) # 
FromJSON (WithJSONWarnings (CustomSnapshot, Maybe Resolver)) # 
FromJSON (WithJSONWarnings (ResolverThat's NotLoaded)) # 
FromJSON (WithJSONWarnings UrlsMonoid) # 
FromJSON (WithJSONWarnings Urls) # 
FromJSON (WithJSONWarnings DockerOptsMonoid) #

Decode uninterpreted docker options from JSON/YAML.

FromJSON (WithJSONWarnings NixOptsMonoid) #

Decode uninterpreted nix options from JSON/YAML.

FromJSON (WithJSONWarnings ImageOptsMonoid) # 
FromJSON (WithJSONWarnings ImageDockerOpts) # 
FromJSON (WithJSONWarnings BenchmarkOptsMonoid) # 
FromJSON (WithJSONWarnings HaddockOptsMonoid) # 
FromJSON (WithJSONWarnings TestOptsMonoid) # 
FromJSON (WithJSONWarnings BuildOptsMonoid) # 
FromJSON (WithJSONWarnings PackageIndex) # 
FromJSON (WithJSONWarnings SetupInfoLocation) # 
FromJSON (WithJSONWarnings SetupInfo) # 
FromJSON (WithJSONWarnings GHCDownloadInfo) # 
FromJSON (WithJSONWarnings VersionedDownloadInfo) # 
FromJSON (WithJSONWarnings DownloadInfo) # 
FromJSON (WithJSONWarnings ProjectAndConfigMonoid) # 
FromJSON (WithJSONWarnings ConfigMonoid) # 
FromJSON (WithJSONWarnings PackageLocation) # 
FromJSON (WithJSONWarnings PackageEntry) # 
type Rep (WithJSONWarnings a) # 
type Rep (WithJSONWarnings a) = D1 (MetaData "WithJSONWarnings" "Data.Aeson.Extended" "stack-1.4.0-8ZOoYP29PHkBBc77OOBSLw" False) (C1 (MetaCons "WithJSONWarnings" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [JSONWarning]))))

jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a #

Handle warnings in a sub-object.

jsonSubWarningsT :: Traversable t => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a) #

Handle warnings in a Traversable of sub-objects.

jsonSubWarningsTT :: (Traversable t, Traversable u) => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a)) #

Handle warnings in a Maybe Traversable of sub-objects.

logJSONWarnings :: MonadLogger m => FilePath -> [JSONWarning] -> m () #

Log JSON warnings.

tellJSONField :: Text -> WarningParser () #

Tell warning parser about an expected field, so it doesn't warn about it.

(..:) :: FromJSON a => Object -> Text -> WarningParser a #

WarningParser version of .:.

(..:?) :: FromJSON a => Object -> Text -> WarningParser (Maybe a) #

WarningParser version of .:?.

(..!=) :: WarningParser (Maybe a) -> a -> WarningParser a #

WarningParser version of .!=.