aeson-jsonpath-0.3.0.2: Parse and run JSONPath queries on Aeson documents

Copyright | (c) 2024-2025 Taimoor Zaeem
License | MIT
Maintainer | Taimoor Zaeem <mtaimoorzaeem@gmail.com>
Stability | Experimental
Portability | Portable
Safe Haskell | None
Language | Haskell2010

Data.Aeson.JSONPath.Types

Description

This module contains all the data structures related to JSONPath

# Documentation

data Query Source #

Constructors

Query |

Fields

- queryType :: QueryType
- querySegments :: [QuerySegment Query]

#### Instances

Instances details

Show Query Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Query Methods showsPrec :: Int -> Query -> ShowS Source # show :: Query -> String Source # showList :: [Query] -> ShowS Source #
Eq Query Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Query Methods (==) :: Query -> Query -> Bool Source # (/=) :: Query -> Query -> Bool Source #
Lift Query Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Query Methods lift :: Quote m => Query -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Query -> Code m Query Source #

data QueryType Source #

Constructors

Root |
Current |

#### Instances

Instances details

Show QueryType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Query Methods showsPrec :: Int -> QueryType -> ShowS Source # show :: QueryType -> String Source # showList :: [QueryType] -> ShowS Source #
Eq QueryType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Query Methods (==) :: QueryType -> QueryType -> Bool Source # (/=) :: QueryType -> QueryType -> Bool Source #
Lift QueryType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Query Methods lift :: Quote m => QueryType -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => QueryType -> Code m QueryType Source #

data QueryState Source #

Constructors

QueryState |

Fields

- rootVal :: Value
- curVal :: Value
- executeQuery :: Query -> QueryState -> Vector Value

data Segment a Source #

Constructors

Bracketed [Selector a] |
Dotted Text |
WildcardSegment |

#### Instances

Instances details

Lift a => Lift (Segment a :: Type) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods lift :: Quote m => Segment a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Segment a -> Code m (Segment a) Source #
Show a => Show (Segment a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods showsPrec :: Int -> Segment a -> ShowS Source # show :: Segment a -> String Source # showList :: [Segment a] -> ShowS Source #
Eq a => Eq (Segment a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods (==) :: Segment a -> Segment a -> Bool Source # (/=) :: Segment a -> Segment a -> Bool Source #

data QuerySegment a Source #

Constructors

QuerySegment |

Fields

- segmentType :: SegmentType
- segment :: Segment a

#### Instances

Instances details

Lift a => Lift (QuerySegment a :: Type) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods lift :: Quote m => QuerySegment a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => QuerySegment a -> Code m (QuerySegment a) Source #
Show a => Show (QuerySegment a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods showsPrec :: Int -> QuerySegment a -> ShowS Source # show :: QuerySegment a -> String Source # showList :: [QuerySegment a] -> ShowS Source #
Eq a => Eq (QuerySegment a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods (==) :: QuerySegment a -> QuerySegment a -> Bool Source # (/=) :: QuerySegment a -> QuerySegment a -> Bool Source #

data SegmentType Source #

Constructors

Child |
Descendant |

#### Instances

Instances details

Show SegmentType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods showsPrec :: Int -> SegmentType -> ShowS Source # show :: SegmentType -> String Source # showList :: [SegmentType] -> ShowS Source #
Eq SegmentType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods (==) :: SegmentType -> SegmentType -> Bool Source # (/=) :: SegmentType -> SegmentType -> Bool Source #
Lift SegmentType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Segment Methods lift :: Quote m => SegmentType -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => SegmentType -> Code m SegmentType Source #

data Selector a Source #

Constructors

Name Text |
Index Int |
ArraySlice (Maybe Int, Maybe Int, Int) |
Filter (LogicalOrExpr a) |
WildcardSelector |

#### Instances

Instances details

Lift a => Lift (Selector a :: Type) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Selector Methods lift :: Quote m => Selector a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Selector a -> Code m (Selector a) Source #
Show a => Show (Selector a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Selector Methods showsPrec :: Int -> Selector a -> ShowS Source # show :: Selector a -> String Source # showList :: [Selector a] -> ShowS Source #
Eq a => Eq (Selector a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Selector Methods (==) :: Selector a -> Selector a -> Bool Source # (/=) :: Selector a -> Selector a -> Bool Source #

data Literal Source #

Constructors

LitString Text |
LitNum Scientific |
LitBool Bool |
LitNull |

#### Instances

Instances details

Show Literal Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> Literal -> ShowS Source # show :: Literal -> String Source # showList :: [Literal] -> ShowS Source #
Eq Literal Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: Literal -> Literal -> Bool Source # (/=) :: Literal -> Literal -> Bool Source #
Lift Literal Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => Literal -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Literal -> Code m Literal Source #

data BasicExpr a Source #

Constructors

Paren (LogicalOrExpr a) |
NotParen (LogicalOrExpr a) |
Test (TestExpr a) |
NotTest (TestExpr a) |
Comparison ComparisonExpr |

#### Instances

Instances details

Lift a => Lift (BasicExpr a :: Type) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => BasicExpr a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => BasicExpr a -> Code m (BasicExpr a) Source #
Show a => Show (BasicExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> BasicExpr a -> ShowS Source # show :: BasicExpr a -> String Source # showList :: [BasicExpr a] -> ShowS Source #
Eq a => Eq (BasicExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: BasicExpr a -> BasicExpr a -> Bool Source # (/=) :: BasicExpr a -> BasicExpr a -> Bool Source #

newtype LogicalOrExpr a Source #

Constructors

LogicalOr [LogicalAndExpr a] |

#### Instances

Instances details

Lift a => Lift (LogicalOrExpr a :: Type) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => LogicalOrExpr a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => LogicalOrExpr a -> Code m (LogicalOrExpr a) Source #
Show a => Show (LogicalOrExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> LogicalOrExpr a -> ShowS Source # show :: LogicalOrExpr a -> String Source # showList :: [LogicalOrExpr a] -> ShowS Source #
Eq a => Eq (LogicalOrExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: LogicalOrExpr a -> LogicalOrExpr a -> Bool Source # (/=) :: LogicalOrExpr a -> LogicalOrExpr a -> Bool Source #

newtype LogicalAndExpr a Source #

Constructors

LogicalAnd [BasicExpr a] |

#### Instances

Instances details

Lift a => Lift (LogicalAndExpr a :: Type) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => LogicalAndExpr a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => LogicalAndExpr a -> Code m (LogicalAndExpr a) Source #
Show a => Show (LogicalAndExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> LogicalAndExpr a -> ShowS Source # show :: LogicalAndExpr a -> String Source # showList :: [LogicalAndExpr a] -> ShowS Source #
Eq a => Eq (LogicalAndExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: LogicalAndExpr a -> LogicalAndExpr a -> Bool Source # (/=) :: LogicalAndExpr a -> LogicalAndExpr a -> Bool Source #

newtype TestExpr a Source #

Constructors

FilterQuery a |

#### Instances

Instances details

Lift a => Lift (TestExpr a :: Type) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => TestExpr a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => TestExpr a -> Code m (TestExpr a) Source #
Show a => Show (TestExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> TestExpr a -> ShowS Source # show :: TestExpr a -> String Source # showList :: [TestExpr a] -> ShowS Source #
Eq a => Eq (TestExpr a) Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: TestExpr a -> TestExpr a -> Bool Source # (/=) :: TestExpr a -> TestExpr a -> Bool Source #

data ComparisonExpr Source #

Constructors

Comp Comparable ComparisonOp Comparable |

#### Instances

Instances details

Show ComparisonExpr Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> ComparisonExpr -> ShowS Source # show :: ComparisonExpr -> String Source # showList :: [ComparisonExpr] -> ShowS Source #
Eq ComparisonExpr Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: ComparisonExpr -> ComparisonExpr -> Bool Source # (/=) :: ComparisonExpr -> ComparisonExpr -> Bool Source #
Lift ComparisonExpr Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => ComparisonExpr -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => ComparisonExpr -> Code m ComparisonExpr Source #

data ComparisonOp Source #

Constructors

Less |
LessOrEqual |
Greater |
GreaterOrEqual |
Equal |
NotEqual |

#### Instances

Instances details

Show ComparisonOp Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> ComparisonOp -> ShowS Source # show :: ComparisonOp -> String Source # showList :: [ComparisonOp] -> ShowS Source #
Eq ComparisonOp Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: ComparisonOp -> ComparisonOp -> Bool Source # (/=) :: ComparisonOp -> ComparisonOp -> Bool Source #
Lift ComparisonOp Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => ComparisonOp -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => ComparisonOp -> Code m ComparisonOp Source #

data Comparable Source #

Constructors

CompLit Literal |
CompSQ SingularQuery |

#### Instances

Instances details

Show Comparable Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> Comparable -> ShowS Source # show :: Comparable -> String Source # showList :: [Comparable] -> ShowS Source #
Eq Comparable Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: Comparable -> Comparable -> Bool Source # (/=) :: Comparable -> Comparable -> Bool Source #
Lift Comparable Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => Comparable -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Comparable -> Code m Comparable Source #

data SingularQueryType Source #

Constructors

RootSQ |
CurrentSQ |

#### Instances

Instances details

Show SingularQueryType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> SingularQueryType -> ShowS Source # show :: SingularQueryType -> String Source # showList :: [SingularQueryType] -> ShowS Source #
Eq SingularQueryType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: SingularQueryType -> SingularQueryType -> Bool Source # (/=) :: SingularQueryType -> SingularQueryType -> Bool Source #
Lift SingularQueryType Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => SingularQueryType -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => SingularQueryType -> Code m SingularQueryType Source #

data SingularQuery Source #

Constructors

SingularQuery |

Fields

- singularQueryType :: SingularQueryType
- singularQuerySegments :: [SingularQuerySegment]

#### Instances

Instances details

Show SingularQuery Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> SingularQuery -> ShowS Source # show :: SingularQuery -> String Source # showList :: [SingularQuery] -> ShowS Source #
Eq SingularQuery Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: SingularQuery -> SingularQuery -> Bool Source # (/=) :: SingularQuery -> SingularQuery -> Bool Source #
Lift SingularQuery Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => SingularQuery -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => SingularQuery -> Code m SingularQuery Source #

data SingularQuerySegment Source #

Constructors

NameSQSeg Text |
IndexSQSeg Int |

#### Instances

Instances details

Show SingularQuerySegment Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods showsPrec :: Int -> SingularQuerySegment -> ShowS Source # show :: SingularQuerySegment -> String Source # showList :: [SingularQuerySegment] -> ShowS Source #
Eq SingularQuerySegment Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods (==) :: SingularQuerySegment -> SingularQuerySegment -> Bool Source # (/=) :: SingularQuerySegment -> SingularQuerySegment -> Bool Source #
Lift SingularQuerySegment Source # |
Instance details Defined in Data.Aeson.JSONPath.Types.Filter Methods lift :: Quote m => SingularQuerySegment -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => SingularQuerySegment -> Code m SingularQuerySegment Source #