Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Parser a b
- type (~>) a b = Parser a b
- run :: (a ~> b) -> a -> Either Errors b
- object :: Value ~> Members
- array :: Value ~> Elements
- string :: Value ~> ShortText
- strings :: Value ~> UnliftedArray ShortText
- number :: Value ~> Scientific
- boolean :: Value ~> Bool
- null :: Value ~> ()
- newtype Members = Members {}
- member :: ShortText -> Members ~> Value
- memberOpt :: ShortText -> Members ~> Maybe Value
- foldMembers :: a -> (a -> Member ~> a) -> Members ~> a
- data Elements
- foldl' :: a -> (a -> Value ~> a) -> Elements ~> a
- map :: (Value ~> a) -> Elements ~> SmallArray a
- fail :: ShortText -> a ~> b
- failZero :: a ~> b
- withObject :: (Members ~> a) -> Value ~> a
- withArray :: (Value ~> a) -> Value ~> SmallArray a
- fromNull :: a -> Value ~> a
- int :: Value ~> Int
- word16 :: Value ~> Word16
- word64 :: Value ~> Word64
- liftMaybe :: ShortText -> (a -> Maybe b) -> a ~> b
Documentation
Instances
Arrow Parser Source # | |
ArrowApply Parser Source # | |
Defined in Json.Arrow | |
ArrowChoice Parser Source # | |
ArrowPlus Parser Source # | |
ArrowZero Parser Source # | |
Defined in Json.Arrow | |
Profunctor Parser Source # | |
Defined in Json.Arrow dimap :: (a -> b) -> (c -> d) -> Parser b c -> Parser a d # lmap :: (a -> b) -> Parser b c -> Parser a c # rmap :: (b -> c) -> Parser a b -> Parser a c # (#.) :: forall a b c q. Coercible c b => q b c -> Parser a b -> Parser a c # (.#) :: forall a b c q. Coercible b a => Parser b c -> q a b -> Parser a c # | |
Category Parser Source # | |
Applicative (Parser a) Source # | |
Functor (Parser a) Source # | |
Run Parser
Primitive Parsers
strings :: Value ~> UnliftedArray ShortText Source #
Parse an array of strings. For example:
["hello","world"]
Failure context includes the index of non-string value if any values in the array are not strings.
Object Members
memberOpt :: ShortText -> Members ~> Maybe Value Source #
An optional member. Returns Nothing if the value is missing.