@@ -33,6 +33,7 @@ module Data.Aeson.Types
@@ -213,6 +214,16 @@ obj .:? key = case M.lookup key obj of
213 Just v -> parseJSON v
214 Just v -> parseJSON v
214{-# INLINE (.:?) #-}
215{-# INLINE (.:?) #-}
217+-- | Traverse a object heirarchy.
218+-- This is useful for traversing a JSON object to get to an
219+-- appropriate place before parsing.
220+(./) :: Value -> Text -> Value
221+(Object obj) ./ key = case M.lookup key obj of
216-- | Create a 'Value' from a list of name\/value 'Pair's. If duplicate
227-- | Create a 'Value' from a list of name\/value 'Pair's. If duplicate
217-- keys arise, earlier keys and their associated values win.
228-- keys arise, earlier keys and their associated values win.
218object :: [Pair] -> Value
229object :: [Pair] -> Value