Safe Haskell | None |
---|---|
Language | Haskell2010 |
A DSL for specification of a single-pass incremental and possibly partial parser of JSON.
- valueToSupplementedParser :: Value a -> Supplemented Parser a
- valueToParser :: Value a -> Parser (a, Parser ())
- valueToByteStringToEither :: Value a -> ByteString -> Either Text a
- valueToLazyByteStringToEither :: Value a -> ByteString -> Either Text a
- data Value a
- null :: Value ()
- nullable :: Value a -> Value (Maybe a)
- bool :: Value Bool
- numberAsInt :: Value Int
- numberAsInteger :: Value Integer
- numberAsDouble :: Value Double
- numberAsScientific :: Value Scientific
- string :: Value Text
- objectRows :: ObjectRows a -> Value a
- objectLookup :: ObjectLookup a -> Value a
- arrayElements :: ArrayElements a -> Value a
- data ObjectRows a
- row :: (a -> b -> c) -> Matcher Text a -> Value b -> ObjectRows c
- anyRow :: ObjectRows ()
- data ObjectLookup a
- atKey :: Text -> Value a -> ObjectLookup a
- data ArrayElements a
- element :: Value a -> ArrayElements a
- anyElement :: ArrayElements ()
- data Matcher a b :: * -> * -> *
- equals :: Eq a => a -> Matcher a ()
- satisfies :: (a -> Bool) -> Matcher a ()
- converts :: (a -> Either Text b) -> Matcher a b
- whatever :: Matcher a ()
Execution
valueToSupplementedParser :: Value a -> Supplemented Parser a Source #
Converts the Value specification into a Supplemented Attoparsec Parser.
valueToParser :: Value a -> Parser (a, Parser ()) Source #
Essentially just a helper, which is the same as
runSupplemented
.valueToSupplementedParser
valueToByteStringToEither :: Value a -> ByteString -> Either Text a Source #
Converts the Value specification into a function, which decodes a strict ByteString.
valueToLazyByteStringToEither :: Value a -> ByteString -> Either Text a Source #
Converts the Value specification into a function, which decodes a strict LazyByteString.
Value
numberAsInt :: Value Int Source #
objectRows :: ObjectRows a -> Value a Source #
objectLookup :: ObjectLookup a -> Value a Source #
arrayElements :: ArrayElements a -> Value a Source #
ObjectRows
data ObjectRows a Source #
anyRow :: ObjectRows () Source #
ObjectLookup
ArrayElements
data ArrayElements a Source #
element :: Value a -> ArrayElements a Source #
anyElement :: ArrayElements () Source #
Matcher
data Matcher a b :: * -> * -> * #
A composable abstraction for checking or converting a context value.
satisfies :: (a -> Bool) -> Matcher a () #
Checks whether the matched value satisfies the provided predicate.