-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An API for parsing "aeson" JSON tree into Haskell types -- -- An API for parsing "aeson" JSON tree into Haskell types @package aeson-value-parser @version 0.14.3 -- | A parser DSL for the "aeson" model of the JSON tree. module Aeson.ValueParser -- | A JSON Value parser. data Value a run :: Value a -> Value -> Either Error a data Error Error :: [Text] -> Text -> Error object :: Object a -> Value a array :: Array a -> Value a null :: Value () nullable :: Value a -> Value (Maybe a) string :: Value Text stringAsBytes :: Value ByteString number :: Value Scientific numberAsInt :: Value Int bool :: Value Bool fromJSON :: FromJSON a => Value a -- | A JSON Value parser. data Object a field :: Text -> Value a -> Object a oneOfFields :: [Text] -> Value a -> Object a -- | Applies the value parser to the existing field, propagating its errors -- accordingly. Only if the field does not exist, it executes -- Alternative branch. IOW, it won't execute Alternative -- branch if Field parser fails. This is what distinguishes -- fieldOr name parser from the seemingly same mplus (field -- name parser) fieldOr :: Text -> Value a -> Object a -> Object a -- | Same as fieldOr, with the only difference that it enumerates -- the provided list of field names parsing the first existing one. oneOfFieldsOr :: [Text] -> Value a -> Object a -> Object a -- | Applies the value parser to the existing field, propagating its errors -- accordingly, but unlike field it doesn't fail if the field does -- not exist. The Maybe wrapper is there to cover such a case. possibleField :: Text -> Value a -> Object (Maybe a) -- | Same as possibleField, with the only difference that it -- enumerates the provided list of field names parsing the first existing -- one. oneOfPossibleFields :: [Text] -> Value a -> Object (Maybe a) fieldMap :: Value a -> Object (HashMap Text a) foldlFields :: (state -> Text -> field -> state) -> state -> Value field -> Object state -- | A JSON Value parser. data Array a element :: Int -> Value a -> Array a elementOr :: Int -> Value a -> Array a -> Array a possibleElement :: Int -> Value a -> Array (Maybe a) elementVector :: Value a -> Array (Vector a) foldlElements :: (state -> Int -> element -> state) -> state -> Value element -> Array state foldrElements :: (Int -> element -> state -> state) -> state -> Value element -> Array state instance Control.Monad.Error.Class.MonadError Aeson.ValueParser.Error.Error Aeson.ValueParser.Array instance GHC.Base.MonadPlus Aeson.ValueParser.Array instance GHC.Base.Monad Aeson.ValueParser.Array instance GHC.Base.Alternative Aeson.ValueParser.Array instance GHC.Base.Applicative Aeson.ValueParser.Array instance GHC.Base.Functor Aeson.ValueParser.Array instance Control.Monad.Error.Class.MonadError Aeson.ValueParser.Error.Error Aeson.ValueParser.Object instance GHC.Base.MonadPlus Aeson.ValueParser.Object instance GHC.Base.Monad Aeson.ValueParser.Object instance GHC.Base.Alternative Aeson.ValueParser.Object instance GHC.Base.Applicative Aeson.ValueParser.Object instance GHC.Base.Functor Aeson.ValueParser.Object instance Control.Monad.Error.Class.MonadError Aeson.ValueParser.Error.Error Aeson.ValueParser.Value instance GHC.Base.MonadPlus Aeson.ValueParser.Value instance GHC.Base.Monad Aeson.ValueParser.Value instance GHC.Base.Alternative Aeson.ValueParser.Value instance GHC.Base.Applicative Aeson.ValueParser.Value instance GHC.Base.Functor Aeson.ValueParser.Value instance Control.Monad.Fail.MonadFail Aeson.ValueParser.Array instance Control.Monad.Fail.MonadFail Aeson.ValueParser.Object instance Control.Monad.Fail.MonadFail Aeson.ValueParser.Value