Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Parser a = Parser {}
- newtype MemberParser a = MemberParser {
- runMemberParser :: Context -> SmallArray Member -> Either Errors a
- run :: Parser a -> Either Errors a
- key :: ShortText -> (Value -> Parser a) -> MemberParser a
- keyOptNull :: ShortText -> (Value -> Parser a) -> MemberParser a
- members :: MemberParser a -> SmallArray Member -> Parser a
- smallArray :: (Value -> Parser a) -> SmallArray Value -> Parser (SmallArray a)
- foldSmallArray :: (b -> a -> Parser b) -> b -> SmallArray a -> Parser b
- traverseMembers :: (Member -> Parser a) -> SmallArray Member -> Parser (SmallArray a)
- object :: Value -> Parser (SmallArray Member)
- array :: Value -> Parser (SmallArray Value)
- number :: Value -> Parser Scientific
- boolean :: Value -> Parser Bool
- string :: Value -> Parser ShortText
- int :: Scientific -> Parser Int
- int32 :: Scientific -> Parser Int32
- word16 :: Scientific -> Parser Word16
- word32 :: Scientific -> Parser Word32
- word64 :: Scientific -> Parser Word64
- fail :: ShortText -> Parser a
- contextually :: (Context -> Context) -> Parser a -> Parser a
Documentation
newtype MemberParser a Source #
MemberParser | |
|
Instances
Alternative MemberParser Source # | |
Defined in Json.Parser empty :: MemberParser a # (<|>) :: MemberParser a -> MemberParser a -> MemberParser a # some :: MemberParser a -> MemberParser [a] # many :: MemberParser a -> MemberParser [a] # | |
Applicative MemberParser Source # | |
Defined in Json.Parser pure :: a -> MemberParser a # (<*>) :: MemberParser (a -> b) -> MemberParser a -> MemberParser b # liftA2 :: (a -> b -> c) -> MemberParser a -> MemberParser b -> MemberParser c # (*>) :: MemberParser a -> MemberParser b -> MemberParser b # (<*) :: MemberParser a -> MemberParser b -> MemberParser a # | |
Functor MemberParser Source # | |
Defined in Json.Parser fmap :: (a -> b) -> MemberParser a -> MemberParser b # (<$) :: a -> MemberParser b -> MemberParser a # | |
Monad MemberParser Source # | |
Defined in Json.Parser (>>=) :: MemberParser a -> (a -> MemberParser b) -> MemberParser b # (>>) :: MemberParser a -> MemberParser b -> MemberParser b # return :: a -> MemberParser a # |
Run
Object Parsing
keyOptNull :: ShortText -> (Value -> Parser a) -> MemberParser a Source #
Variant of key
that supplies the JSON value null
to the
callback if the key is not found. Using this parser combinators implies
that there is no distinction between null
and an absent value in
the encoding scheme.
members :: MemberParser a -> SmallArray Member -> Parser a Source #
Arrays
smallArray :: (Value -> Parser a) -> SmallArray Value -> Parser (SmallArray a) Source #
Run the same parser against every element in a SmallArray
. This adjusts
the context at each element.
foldSmallArray :: (b -> a -> Parser b) -> b -> SmallArray a -> Parser b Source #
Run the parser against every element in a SmallArray
, updating an
accumulator at each step. Folds from left to right. This adjusts
the context at each element. Typically, type a
is Value
.
traverseMembers :: (Member -> Parser a) -> SmallArray Member -> Parser (SmallArray a) Source #
Traverse the members. The adjusts the context at each member.