-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | API for parsing "aeson" JSON tree into Haskell types -- -- A flexible parser DSL of JSON AST produced by the "aeson" library with -- automated and highly detailed error reporting. Provides a featureful -- toolkit for parsing real-world documents with schemas of any -- complexity or ambiguity, which the FromJSON instances are -- simply not fit for. @package aeson-value-parser @version 0.19.7.2 module AesonValueParser -- | JSON Value AST parser. -- -- Its Alternative instance implements the logic of choosing -- between the possible types of JSON values. data Value a run :: Value a -> Value -> Either Error a runWithTextError :: Value a -> Value -> Either Text a -- | Convert into a function directly applicable as definition of -- parseJSON. -- -- Here's an example of how it can be used: -- --
--   data Artist = Artist
--     { artistName :: Text,
--       artistGenres :: [Text]
--     }
--   
--   instance FromJSON Artist where
--     parseJSON = runAsValueParser $
--       object $ do
--         name <- field "name" $ string text
--         genres <- field "genres" $ array $ elementList $ string text
--         return $ Artist name genres
--   
runAsValueParser :: Value a -> Value -> Parser a data Error Error :: [Text] -> Text -> Error parseByteString :: Value a -> ByteString -> Either Text a object :: Object a -> Value a array :: Array a -> Value a null :: Value () nullable :: Value a -> Value (Maybe a) nullableMonoid :: Monoid a => Value a -> Value a string :: String a -> Value a number :: Number a -> Value a bool :: Value Bool fromJSON :: FromJSON a => Value a data String a text :: String Text mappedText :: [(Text, a)] -> String a narrowedText :: (Text -> Maybe a) -> String a matchedText :: (Text -> Either Text a) -> String a attoparsedText :: Parser a -> String a megaparsedText :: Parsec Void Text a -> String a data Number a scientific :: Number Scientific integer :: (Integral a, Bounded a) => Number a floating :: RealFloat a => Number a matchedScientific :: (Scientific -> Either Text a) -> Number a matchedInteger :: (Integral integer, Bounded integer) => (integer -> Either Text a) -> Number a matchedFloating :: RealFloat floating => (floating -> Either Text a) -> Number a -- | JSON Value parser. data Object a field :: Text -> Value a -> Object a oneOfFields :: [Text] -> Value a -> Object a fieldMap :: Hashable a => String a -> Value b -> Object (HashMap a b) foldlFields :: (state -> key -> field -> state) -> state -> String key -> Value field -> Object state fieldsAmount :: Object Int -- | JSON Value parser. data Array a element :: Int -> Value a -> Array a elementVector :: Value a -> Array (Vector a) elementList :: Value a -> Array [a] foldlElements :: (state -> Int -> element -> state) -> state -> Value element -> Array state foldrElements :: (Int -> element -> state -> state) -> state -> Value element -> Array state elementsAmount :: Array Int instance GHC.Base.Applicative AesonValueParser.Value instance GHC.Base.Functor AesonValueParser.Value instance GHC.Base.Alternative AesonValueParser.String instance GHC.Base.Applicative AesonValueParser.String instance GHC.Base.Functor AesonValueParser.String instance GHC.Base.Alternative AesonValueParser.Number instance GHC.Base.Applicative AesonValueParser.Number instance GHC.Base.Functor AesonValueParser.Number instance Control.Monad.Error.Class.MonadError AesonValueParser.Error.Error AesonValueParser.Object instance GHC.Base.MonadPlus AesonValueParser.Object instance GHC.Base.Monad AesonValueParser.Object instance GHC.Base.Alternative AesonValueParser.Object instance GHC.Base.Applicative AesonValueParser.Object instance GHC.Base.Functor AesonValueParser.Object instance Control.Monad.Error.Class.MonadError AesonValueParser.Error.Error AesonValueParser.Array instance GHC.Base.MonadPlus AesonValueParser.Array instance GHC.Base.Monad AesonValueParser.Array instance GHC.Base.Alternative AesonValueParser.Array instance GHC.Base.Applicative AesonValueParser.Array instance GHC.Base.Functor AesonValueParser.Array instance Control.Monad.Fail.MonadFail AesonValueParser.Array instance Control.Monad.Fail.MonadFail AesonValueParser.Object instance GHC.Base.Alternative AesonValueParser.Value