bos/aeson — pull request #220 by maximkulkin (2014-09-23 12:36:52+00:00)
Title: Add json path to parse error messages

Every time you parse some JSON and get error message, it is very painful to track where the error is because existing error messages do not point to the place in JSON where parse error occured. JSON syntax errors are reporting from Attoparsec parser and it gives position. But JSON conversion errors have no support for tracking position/context so quality of error messages is poor.

This change adds json path to error message:
1. Parser tracks current JSON path (in reverse order)
2. An `` operation is added to annotate Parser with JSON context (JSON path)
3. Built-in FromJSON instances are updated to provide context information
4. `.:` and `.:?` operations automatically add context information.

Context is reported in form of [JSON-Path](https://code.google.com/p/json-path/) expression e.g. `$.store.book[0].title`:
```
> eitherDecode storeJsonString :: Either String Store
Left "Error in \"$.store.book[0]\": key \"title\" not present"
```

Caveats:
1. There is `modifyFailure` method. Now it receives final message with JSON information already embedded which is different from existing implementation where it received unmodified error messages. This can break backward compatibility if someone has matched error message strings in it as they have changed. If this method was used just for prepending/appending text to error messages, it should be fine.
2. There is no tests for error message yet. I believe those should be done in normal xUnit assertion style instead of QuickCheck property style.