Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Value a
- run :: Value a -> Value -> Either Error a
- runWithTextError :: Value a -> Value -> Either Text a
- data Error = Error [Text] Text
- 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
- data Object a
- field :: Text -> Value a -> Object a
- oneOfFields :: [Text] -> Value a -> Object a
- fieldMap :: (Eq a, 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
- 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
- elementsAmount :: Array Int
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
Show Error Source # | |
IsString Error Source # | |
Defined in AesonValueParser.Error fromString :: String -> Error # | |
Semigroup Error Source # | |
Monoid Error Source # | |
MonadError Error Array Source # | |
Defined in AesonValueParser throwError :: Error -> Array a # | |
MonadError Error Object Source # | |
Defined in AesonValueParser throwError :: Error -> Object a # |
parseByteString :: Value a -> ByteString -> Either Text a Source #
Value parsers
String parsers
mappedText :: [(Text, a)] -> String a Source #
attoparsedText :: 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 Object
parser.
foldlFields :: (state -> key -> field -> state) -> state -> String key -> Value field -> Object state Source #
fieldsAmount :: Object Int Source #
Array parsers
JSON Array
parser.
foldlElements :: (state -> Int -> element -> state) -> state -> Value element -> Array state Source #