stack-1.1.2: 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)) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings (CustomSnapshot, Maybe Resolver))

FromJSON (WithJSONWarnings DockerOptsMonoid)

Decode uninterpreted docker options from JSON/YAML.

Methods

parseJSON :: Value -> Parser (WithJSONWarnings DockerOptsMonoid)

FromJSON (WithJSONWarnings NixOptsMonoid)

Decode uninterpreted nix options from JSON/YAML.

Methods

parseJSON :: Value -> Parser (WithJSONWarnings NixOptsMonoid)

FromJSON (WithJSONWarnings ImageOptsMonoid) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings ImageOptsMonoid)

FromJSON (WithJSONWarnings ImageDockerOpts) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings ImageDockerOpts)

FromJSON (WithJSONWarnings UrlsMonoid) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings UrlsMonoid)

FromJSON (WithJSONWarnings Urls) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings Urls)

FromJSON (WithJSONWarnings BenchmarkOptsMonoid) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings BenchmarkOptsMonoid)

FromJSON (WithJSONWarnings HaddockOptsMonoid) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings HaddockOptsMonoid)

FromJSON (WithJSONWarnings TestOptsMonoid) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings TestOptsMonoid)

FromJSON (WithJSONWarnings BuildOptsMonoid) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings BuildOptsMonoid)

FromJSON (WithJSONWarnings SetupInfoLocation) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings SetupInfoLocation)

FromJSON (WithJSONWarnings SetupInfo) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings SetupInfo)

FromJSON (WithJSONWarnings VersionedDownloadInfo) 
FromJSON (WithJSONWarnings DownloadInfo) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings DownloadInfo)

FromJSON (WithJSONWarnings ProjectAndConfigMonoid) 
FromJSON (WithJSONWarnings ConfigMonoid) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings ConfigMonoid)

FromJSON (WithJSONWarnings PackageLocation) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings PackageLocation)

FromJSON (WithJSONWarnings PackageEntry) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings PackageEntry)

FromJSON (WithJSONWarnings PackageIndex) 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings PackageIndex)

type Rep (WithJSONWarnings a) # 
type Rep (WithJSONWarnings a) = D1 (MetaData "WithJSONWarnings" "Data.Aeson.Extended" "stack-1.1.2-49dhs7u8deFCRPHWDHyZQB" False) (C1 (MetaCons "WithJSONWarnings" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [JSONWarning]))))

withObjectWarnings :: String -> (Object -> WarningParser a) -> Value -> Parser (WithJSONWarnings a) #

WarningParser version of withObject.

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.

unWarningParser :: WarningParser a -> Parser a #

Convert a WarningParser to a Parser.

(..:) :: 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 .!=.