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

Json.Arrow

Synopsis

Documentation

data Parser a b Source #

Instances

Instances details
Arrow Parser Source # 
Instance details

Defined in Json.Arrow

Methods

arr :: (b -> c) -> Parser b c #

first :: Parser b c -> Parser (b, d) (c, d) #

second :: Parser b c -> Parser (d, b) (d, c) #

(***) :: Parser b c -> Parser b' c' -> Parser (b, b') (c, c') #

(&&&) :: Parser b c -> Parser b c' -> Parser b (c, c') #

ArrowApply Parser Source # 
Instance details

Defined in Json.Arrow

Methods

app :: Parser (Parser b c, b) c #

ArrowChoice Parser Source # 
Instance details

Defined in Json.Arrow

Methods

left :: Parser b c -> Parser (Either b d) (Either c d) #

right :: Parser b c -> Parser (Either d b) (Either d c) #

(+++) :: Parser b c -> Parser b' c' -> Parser (Either b b') (Either c c') #

(|||) :: Parser b d -> Parser c d -> Parser (Either b c) d #

ArrowPlus Parser Source # 
Instance details

Defined in Json.Arrow

Methods

(<+>) :: Parser b c -> Parser b c -> Parser b c #

ArrowZero Parser Source # 
Instance details

Defined in Json.Arrow

Methods

zeroArrow :: Parser b c #

Profunctor Parser Source # 
Instance details

Defined in Json.Arrow

Methods

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 # 
Instance details

Defined in Json.Arrow

Methods

id :: forall (a :: k). Parser a a #

(.) :: forall (b :: k) (c :: k) (a :: k). Parser b c -> Parser a b -> Parser a c #

Applicative (Parser a) Source # 
Instance details

Defined in Json.Arrow

Methods

pure :: a0 -> Parser a a0 #

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

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

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

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

Functor (Parser a) Source # 
Instance details

Defined in Json.Arrow

Methods

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

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

type (~>) a b = Parser a b Source #

Run Parser

run :: (a ~> b) -> a -> Either Errors b Source #

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

newtype Members Source #

Constructors

Members 

memberOpt :: ShortText -> Members ~> Maybe Value Source #

An optional member. Returns Nothing if the value is missing.

foldMembers :: a -> (a -> Member ~> a) -> Members ~> a Source #

Array Elements

foldl' :: a -> (a -> Value ~> a) -> Elements ~> a Source #

Primitive Combinators

Trivial Combinators

Conversion

liftMaybe Source #

Arguments

:: ShortText

Message to display on decode error

-> (a -> Maybe b)

Decode function

-> a ~> b