on master help sign in
Fix docs for <?>
83fdf3eBryan O'Sullivan
Data/Aeson/Types/Internal.hs+6−5
@@ -421,19 +421,20 @@ object = Object . H.fromList
421
421
422-- | Add JSON Path context to a parser
422-- | Add JSON Path context to a parser
423--
423--
424−-- When parsing complex structure it helps to annotate (sub)parsers
424+-- When parsing a complex structure, it helps to annotate (sub)parsers
425−-- with context so that if error occurs you can find it's location.
425+-- with context, so that if an error occurs, you can find its location.
426--
426--
427-- > withObject "Person" $ \o ->
427-- > withObject "Person" $ \o ->
428-- > Person
428-- > Person
429-- > <$> o .: "name" <?> Key "name"
429-- > <$> o .: "name" <?> Key "name"
430-- > <*> o .: "age" <?> Key "age"
430-- > <*> o .: "age" <?> Key "age"
431--
431--
432−-- (except for standard methods like '(.:)' already do that)
432+-- (Standard methods like '(.:)' already do this.)
433--
433--
434+-- With such annotations, if an error occurs, you will get a JSON Path
434−-- After that in case of error you will get a JSON Path location of that error.
435+-- location of that error.
435--
436--
436−-- Since 0.9
437+-- Since 0.10
437(<?>) :: Parser a -> JSONPathElement -> Parser a
438(<?>) :: Parser a -> JSONPathElement -> Parser a
438p <?> pathElem = Parser $ \path kf ks -> runParser p (pathElem:path) kf ks
439p <?> pathElem = Parser $ \path kf ks -> runParser p (pathElem:path) kf ks
439
440