Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Value a
- run :: Value a -> Value -> Either Error a
- data Error = Error [Text] Text
- object :: Object a -> Value a
- array :: Array a -> Value a
- null :: Value ()
- nullable :: Value a -> Value (Maybe 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
- matchedText :: (Text -> Either Text a) -> String a
- parsedText :: Parser 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
- data Object a
- field :: Text -> Value a -> Object a
- oneOfFields :: [Text] -> Value a -> Object a
- fieldMap :: Value a -> Object (HashMap Text a)
- foldlFields :: (state -> Text -> field -> state) -> state -> Value field -> Object state
- data Array a
- element :: Int -> Value a -> Array 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
Documentation
JSON Value
AST parser.
Its Alternative
instance implements the logic of choosing between the possible types of JSON values.
Instances
Functor Value Source # | |
Applicative Value Source # | |
Alternative Value Source # | Implements the logic of choosing between the possible types of JSON values. If you have multiple parsers of the same type of JSON value composed, only the leftmost will be affective. The errors from deeper parsers do not trigger the alternation, instead they get propagated to the top. |
Instances
IsString Error Source # | |
Defined in Aeson.ValueParser.Error fromString :: String -> Error # | |
Semigroup Error Source # | |
Monoid Error Source # | |
MonadError Error Array Source # | |
Defined in Aeson.ValueParser throwError :: Error -> Array a # | |
MonadError Error Object Source # | |
Defined in Aeson.ValueParser throwError :: Error -> Object a # |
Value parsers
String parsers
parsedText :: Parser a -> String a Source #
Number parsers
matchedScientific :: (Scientific -> Either Text a) -> Number a Source #
matchedInteger :: (Integral integer, Bounded integer) => (integer -> Either Text a) -> Number a Source #
Object parsers
JSON Value
parser.
Array parsers
JSON Value
parser.