@@ -68,11 +68,14 @@ import Data.Vector (Vector)
68import qualified Data.HashMap.Strict as H
68import qualified Data.HashMap.Strict as H
69import qualified Data.Vector as V
69import qualified Data.Vector as V
71−-- | Elements of JSON path used to describe error location
71+-- | Elements of a JSON path used to describe the location of an
72−data JSONPathElement = -- ^ "object.key" JSON path element
73+data JSONPathElement = Key Text
74− -- ^ "array[index]" JSON path element
74+ -- ^ JSON path element of a key into an object,
75− | Index {-# UNPACK #-} !Int
76+ | Index {-# UNPACK #-} !Int
77+ -- ^ JSON path element of an index into an
78+ -- array, \"array[index]\".
76 deriving (Eq, Show, Typeable)
79 deriving (Eq, Show, Typeable)
77type JSONPath = [JSONPathElement]
80type JSONPath = [JSONPathElement]