aeson-match-qq-1.6.1: Declarative JSON matchers.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Aeson.Match.QQ.Internal.Value

Synopsis

Documentation

data Matcher ext Source #

A value constructed using qq that attempts to match a JSON document.

Constructors

Hole (Maybe HoleSig) (Maybe Text)

Optionally typed, optionally named _hole. If a type is provided, the _hole only matches those values that have that type. If a name is provided, the matched value is returned to the user.

Null 
Bool Bool 
Number Scientific 
String Text 
StringCI (CI Text)

Case-insensitive strings

Array (Array ext) 
ArrayUO (Array ext)

Unordered arrays

Object (Object ext) 
Ext ext

External values spliced into a Matcher using the `#{}` syntax

Instances

Instances details
Functor Matcher Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

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

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

ext ~ Exp => Lift (Matcher ext :: Type) Source #

Convert `Matcher Exp` to `Matcher Value`. This uses a roundabout way to get Value from toEncoding to avoid calling toJSON which may be undefined for some datatypes.

Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

lift :: Quote m => Matcher ext -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Matcher ext -> Code m (Matcher ext) #

ToJSON ext => ToJSON (Matcher ext) Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Show ext => Show (Matcher ext) Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

showsPrec :: Int -> Matcher ext -> ShowS #

show :: Matcher ext -> String #

showList :: [Matcher ext] -> ShowS #

Eq ext => Eq (Matcher ext) Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

(==) :: Matcher ext -> Matcher ext -> Bool #

(/=) :: Matcher ext -> Matcher ext -> Bool #

data Box a Source #

A wrapper for those matchers that support the ... syntax.

Constructors

Box 

Fields

Instances

Instances details
Functor Box Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

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

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

ToJSON a => ToJSON (Box a) Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

toJSON :: Box a -> Value #

toEncoding :: Box a -> Encoding #

toJSONList :: [Box a] -> Value #

toEncodingList :: [Box a] -> Encoding #

Show a => Show (Box a) Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

showsPrec :: Int -> Box a -> ShowS #

show :: Box a -> String #

showList :: [Box a] -> ShowS #

Eq a => Eq (Box a) Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

(==) :: Box a -> Box a -> Bool #

(/=) :: Box a -> Box a -> Bool #

type Array ext = Box (Vector (Matcher ext)) Source #

type Object ext = Box (HashMap Text (Matcher ext)) Source #

data HoleSig Source #

_hole type signature

Constructors

HoleSig 

Fields

Instances

Instances details
ToJSON HoleSig Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Show HoleSig Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Eq HoleSig Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

(==) :: HoleSig -> HoleSig -> Bool #

(/=) :: HoleSig -> HoleSig -> Bool #

Lift HoleSig Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

lift :: Quote m => HoleSig -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => HoleSig -> Code m HoleSig #

data Type Source #

_hole type

Constructors

BoolT
_ : bool
NumberT
_ : number
StringT
_ : string
StringCIT
_ : ci-string
ArrayT
_ : array
ArrayUOT
_ : unordered-array
ObjectT
_ : object

Instances

Instances details
ToJSON Type Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Show Type Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Eq Type Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Lift Type Source # 
Instance details

Defined in Aeson.Match.QQ.Internal.Value

Methods

lift :: Quote m => Type -> m Exp #

liftTyped :: forall (m :: Type0 -> Type0). Quote m => Type -> Code m Type #