-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | RFC 9535 compliant JSONPath parsing and querying package. JSONPath is -- similar to XPath for querying XML documents. @package aeson-jsonpath @version 0.3.0.0 -- | This module contains the data structures. module Data.Aeson.JSONPath.Query.Types data Query Query :: QueryType -> [QuerySegment] -> Query [queryType] :: Query -> QueryType [querySegments] :: Query -> [QuerySegment] data QueryType Root :: QueryType Current :: QueryType data Segment Bracketed :: [Selector] -> Segment Dotted :: Text -> Segment WildcardSegment :: Segment data QuerySegment QuerySegment :: SegmentType -> Segment -> QuerySegment [segmentType] :: QuerySegment -> SegmentType [segment] :: QuerySegment -> Segment data SegmentType Child :: SegmentType Descendant :: SegmentType data Selector Name :: Text -> Selector Index :: Int -> Selector ArraySlice :: (Maybe Int, Maybe Int, Int) -> Selector Filter :: LogicalOrExpr -> Selector WildcardSelector :: Selector newtype LogicalOrExpr LogicalOr :: [LogicalAndExpr] -> LogicalOrExpr newtype LogicalAndExpr LogicalAnd :: [BasicExpr] -> LogicalAndExpr data BasicExpr Paren :: LogicalOrExpr -> BasicExpr NotParen :: LogicalOrExpr -> BasicExpr Test :: TestExpr -> BasicExpr NotTest :: TestExpr -> BasicExpr Comparison :: ComparisonExpr -> BasicExpr type TestExpr = Query data ComparisonExpr Comp :: Comparable -> ComparisonOp -> Comparable -> ComparisonExpr data ComparisonOp Less :: ComparisonOp LessOrEqual :: ComparisonOp Greater :: ComparisonOp GreaterOrEqual :: ComparisonOp Equal :: ComparisonOp NotEqual :: ComparisonOp data Comparable CompLitString :: Text -> Comparable CompLitNum :: Scientific -> Comparable CompLitBool :: Bool -> Comparable CompLitNull :: Comparable CompSQ :: SingularQuery -> Comparable data SingularQuery SingularQuery :: SingularQueryType -> [SingularQuerySegment] -> SingularQuery [singularQueryType] :: SingularQuery -> SingularQueryType [singularQuerySegments] :: SingularQuery -> [SingularQuerySegment] data SingularQueryType RootSQ :: SingularQueryType CurrentSQ :: SingularQueryType data SingularQuerySegment NameSQSeg :: Text -> SingularQuerySegment IndexSQSeg :: Int -> SingularQuerySegment instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.QueryType instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.QueryType instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.QueryType instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.SegmentType instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.SegmentType instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.SegmentType instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.ComparisonOp instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.ComparisonOp instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.ComparisonOp instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.SingularQueryType instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.SingularQueryType instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.SingularQueryType instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.SingularQuerySegment instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.SingularQuerySegment instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.SingularQuerySegment instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.SingularQuery instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.SingularQuery instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.SingularQuery instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.Comparable instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.Comparable instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.Comparable instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.ComparisonExpr instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.ComparisonExpr instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.ComparisonExpr instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.LogicalAndExpr instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.LogicalAndExpr instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.LogicalAndExpr instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.LogicalOrExpr instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.LogicalOrExpr instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.LogicalOrExpr instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.Selector instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.Selector instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.Selector instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.Segment instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.Segment instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.Segment instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.QuerySegment instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.QuerySegment instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.QuerySegment instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.Query instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.Query instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.Query instance Language.Haskell.TH.Syntax.Lift Data.Aeson.JSONPath.Query.Types.BasicExpr instance GHC.Show.Show Data.Aeson.JSONPath.Query.Types.BasicExpr instance GHC.Classes.Eq Data.Aeson.JSONPath.Query.Types.BasicExpr -- | This module contains core functions that runs the query on -- Value. module Data.Aeson.JSONPath.Query class Queryable a query' :: Queryable a => a -> Value -> Value -> Vector Value queryLocated' :: Queryable a => a -> Value -> Value -> String -> Vector (String, Value) instance Data.Aeson.JSONPath.Query.Queryable Data.Aeson.JSONPath.Query.Types.Query instance Data.Aeson.JSONPath.Query.Queryable Data.Aeson.JSONPath.Query.Types.QuerySegment instance Data.Aeson.JSONPath.Query.Queryable Data.Aeson.JSONPath.Query.Types.Segment instance Data.Aeson.JSONPath.Query.Queryable Data.Aeson.JSONPath.Query.Types.Selector -- | Parses raw query to Haskell Algebraic Data Types module Data.Aeson.JSONPath.Parser -- | Query parser pQuery :: Parser Query -- | Run JSONPath queries on Aeson Values using methods exported in this -- module. module Data.Aeson.JSONPath -- | Use when query string is not known at compile time -- --
--   >>> query "$.artist" json
--   Right [String "David Bowie"]
--   
--   >>> query "$.art[ist" json
--   Left "failed to parse query: $.art[ist" (line 1, column 7)
--   
-- -- For detailed usage examples, see: -- https://github.com/taimoorzaeem/aeson-jsonpath?tab=readme-ov-file#aeson-jsonpath query :: String -> Value -> Either ParseError (Vector Value) -- | Use when query string is known at compile time -- --
--   artist = queryQQ [jsonPath|$.artist|] json -- successfully compiles
--   
--   >>> artist
--   [String "David Bowie"]
--   
-- --
--   artist = queryQQ [jsonPath|$.art[ist|] json -- fails at compilation time
--   
queryQQ :: Query -> Value -> Vector Value -- | Get the location of the returned nodes along with the node -- --
--   >>> queryLocated "$.title" json
--   Right [("$['title']",String "Space Oddity")]
--   
queryLocated :: String -> Value -> Either ParseError (Vector (String, Value)) -- | Same as queryLocated but allows QuasiQuoter -- --
--   artist = queryLocatedQQ [jsonPath|$.*|] json -- successfully compiles
--   
--   >>> artist
--   [("$['artist']",String "David Bowie"),
--    ("$['title']",String "Space Oddity")]
--   
queryLocatedQQ :: Query -> Value -> Vector (String, Value) -- | A QuasiQuoter for checking valid JSONPath syntax at compile -- time -- --
--   path :: Query
--   path = [jsonPath|$.store.records[0,1]|]
--   
jsonPath :: QuasiQuoter