json-query-0.2.3.1: Kitchen sink for querying JSON
Safe HaskellSafe-Inferred
LanguageHaskell2010

Json.Parser

Synopsis

Documentation

newtype Parser a Source #

Constructors

Parser 

Fields

Instances

Instances details
Alternative Parser Source # 
Instance details

Defined in Json.Parser

Methods

empty :: Parser a #

(<|>) :: Parser a -> Parser a -> Parser a #

some :: Parser a -> Parser [a] #

many :: Parser a -> Parser [a] #

Applicative Parser Source # 
Instance details

Defined in Json.Parser

Methods

pure :: a -> Parser a #

(<*>) :: Parser (a -> b) -> Parser a -> Parser b #

liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c #

(*>) :: Parser a -> Parser b -> Parser b #

(<*) :: Parser a -> Parser b -> Parser a #

Functor Parser Source # 
Instance details

Defined in Json.Parser

Methods

fmap :: (a -> b) -> Parser a -> Parser b #

(<$) :: a -> Parser b -> Parser a #

Monad Parser Source # 
Instance details

Defined in Json.Parser

Methods

(>>=) :: Parser a -> (a -> Parser b) -> Parser b #

(>>) :: Parser a -> Parser b -> Parser b #

return :: a -> Parser a #

newtype MemberParser a Source #

Instances

Instances details
Alternative MemberParser Source # 
Instance details

Defined in Json.Parser

Applicative MemberParser Source # 
Instance details

Defined in Json.Parser

Functor MemberParser Source # 
Instance details

Defined in Json.Parser

Methods

fmap :: (a -> b) -> MemberParser a -> MemberParser b #

(<$) :: a -> MemberParser b -> MemberParser a #

Monad MemberParser Source # 
Instance details

Defined in Json.Parser

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.

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.

Specific Data Constructors

Trivial Combinators

Failing

Modified Context

contextually :: (Context -> Context) -> Parser a -> Parser a Source #

Run a parser in a modified context.