{-# LANGUAGE DeriveLift #-}
module Data.Aeson.JSONPath.Types.Query
( Query (..)
, QueryType (..)
, QueryState (..)
)
where
import Data.Aeson (Value)
import Data.Vector (Vector)
import Data.Aeson.JSONPath.Types.Segment (QuerySegment (..))
import Language.Haskell.TH.Syntax (Lift)
import Prelude
data QueryState = QueryState
{ QueryState -> Value
rootVal :: Value
, QueryState -> Value
curVal :: Value
, QueryState -> Query -> QueryState -> Vector Value
executeQuery :: Query -> QueryState -> Vector Value
}
data QueryType
= Root
| Current
deriving (QueryType -> QueryType -> Bool
(QueryType -> QueryType -> Bool)
-> (QueryType -> QueryType -> Bool) -> Eq QueryType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryType -> QueryType -> Bool
== :: QueryType -> QueryType -> Bool
$c/= :: QueryType -> QueryType -> Bool
/= :: QueryType -> QueryType -> Bool
Eq, Int -> QueryType -> ShowS
[QueryType] -> ShowS
QueryType -> String
(Int -> QueryType -> ShowS)
-> (QueryType -> String)
-> ([QueryType] -> ShowS)
-> Show QueryType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryType -> ShowS
showsPrec :: Int -> QueryType -> ShowS
$cshow :: QueryType -> String
show :: QueryType -> String
$cshowList :: [QueryType] -> ShowS
showList :: [QueryType] -> ShowS
Show, (forall (m :: * -> *). Quote m => QueryType -> m Exp)
-> (forall (m :: * -> *). Quote m => QueryType -> Code m QueryType)
-> Lift QueryType
forall t.
(forall (m :: * -> *). Quote m => t -> m Exp)
-> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
forall (m :: * -> *). Quote m => QueryType -> m Exp
forall (m :: * -> *). Quote m => QueryType -> Code m QueryType
$clift :: forall (m :: * -> *). Quote m => QueryType -> m Exp
lift :: forall (m :: * -> *). Quote m => QueryType -> m Exp
$cliftTyped :: forall (m :: * -> *). Quote m => QueryType -> Code m QueryType
liftTyped :: forall (m :: * -> *). Quote m => QueryType -> Code m QueryType
Lift)
data Query = Query
{ Query -> QueryType
queryType :: QueryType
, Query -> [QuerySegment Query]
querySegments :: [QuerySegment Query]
} deriving (Query -> Query -> Bool
(Query -> Query -> Bool) -> (Query -> Query -> Bool) -> Eq Query
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Query -> Query -> Bool
== :: Query -> Query -> Bool
$c/= :: Query -> Query -> Bool
/= :: Query -> Query -> Bool
Eq, Int -> Query -> ShowS
[Query] -> ShowS
Query -> String
(Int -> Query -> ShowS)
-> (Query -> String) -> ([Query] -> ShowS) -> Show Query
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Query -> ShowS
showsPrec :: Int -> Query -> ShowS
$cshow :: Query -> String
show :: Query -> String
$cshowList :: [Query] -> ShowS
showList :: [Query] -> ShowS
Show, (forall (m :: * -> *). Quote m => Query -> m Exp)
-> (forall (m :: * -> *). Quote m => Query -> Code m Query)
-> Lift Query
forall t.
(forall (m :: * -> *). Quote m => t -> m Exp)
-> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
forall (m :: * -> *). Quote m => Query -> m Exp
forall (m :: * -> *). Quote m => Query -> Code m Query
$clift :: forall (m :: * -> *). Quote m => Query -> m Exp
lift :: forall (m :: * -> *). Quote m => Query -> m Exp
$cliftTyped :: forall (m :: * -> *). Quote m => Query -> Code m Query
liftTyped :: forall (m :: * -> *). Quote m => Query -> Code m Query
Lift)