1[
2  {
3    "url": "https://api.github.com/repos/bos/aeson/issues/772",
4    "repository_url": "https://api.github.com/repos/bos/aeson",
5    "labels_url": "https://api.github.com/repos/bos/aeson/issues/772/labels{/name}",
6    "comments_url": "https://api.github.com/repos/bos/aeson/issues/772/comments",
7    "events_url": "https://api.github.com/repos/bos/aeson/issues/772/events",
8    "html_url": "https://github.com/bos/aeson/pull/772",
9    "id": 593935498,
10    "node_id": "MDExOlB1bGxSZXF1ZXN0Mzk4NjI4OTIx",
11    "number": 772,
12    "title": "WIP: Add cabal.bench.project for running benchmarks",
13    "user": {
14      "login": "phadej",
15      "id": 51087,
16      "node_id": "MDQ6VXNlcjUxMDg3",
17      "avatar_url": "https://avatars2.githubusercontent.com/u/51087?v=4",
18      "gravatar_id": "",
19      "url": "https://api.github.com/users/phadej",
20      "html_url": "https://github.com/phadej",
21      "followers_url": "https://api.github.com/users/phadej/followers",
22      "following_url": "https://api.github.com/users/phadej/following{/other_user}",
23      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",
24      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",
25      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",
26      "organizations_url": "https://api.github.com/users/phadej/orgs",
27      "repos_url": "https://api.github.com/users/phadej/repos",
28      "events_url": "https://api.github.com/users/phadej/events{/privacy}",
29      "received_events_url": "https://api.github.com/users/phadej/received_events",
30      "type": "User",
31      "site_admin": false
32    },
33    "labels": [
34
35    ],
36    "state": "open",
37    "locked": false,
38    "assignee": null,
39    "assignees": [
40
41    ],
42    "milestone": null,
43    "comments": 1,
44    "created_at": "2020-04-04T15:53:53Z",
45    "updated_at": "2020-04-07T11:10:42Z",
46    "closed_at": null,
47    "author_association": "CONTRIBUTOR",
48    "pull_request": {
49      "url": "https://api.github.com/repos/bos/aeson/pulls/772",
50      "html_url": "https://github.com/bos/aeson/pull/772",
51      "diff_url": "https://github.com/bos/aeson/pull/772.diff",
52      "patch_url": "https://github.com/bos/aeson/pull/772.patch"
53    },
54    "body": ""
55  },
56  {
57    "url": "https://api.github.com/repos/bos/aeson/issues/768",
58    "repository_url": "https://api.github.com/repos/bos/aeson",
59    "labels_url": "https://api.github.com/repos/bos/aeson/issues/768/labels{/name}",
60    "comments_url": "https://api.github.com/repos/bos/aeson/issues/768/comments",
61    "events_url": "https://api.github.com/repos/bos/aeson/issues/768/events",
62    "html_url": "https://github.com/bos/aeson/pull/768",
63    "id": 593798540,
64    "node_id": "MDExOlB1bGxSZXF1ZXN0Mzk4NTA2NDAy",
65    "number": 768,
66    "title": "Implement JSON parser using scanner",
67    "user": {
68      "login": "Yuras",
69      "id": 692251,
70      "node_id": "MDQ6VXNlcjY5MjI1MQ==",
71      "avatar_url": "https://avatars0.githubusercontent.com/u/692251?v=4",
72      "gravatar_id": "",
73      "url": "https://api.github.com/users/Yuras",
74      "html_url": "https://github.com/Yuras",
75      "followers_url": "https://api.github.com/users/Yuras/followers",
76      "following_url": "https://api.github.com/users/Yuras/following{/other_user}",
77      "gists_url": "https://api.github.com/users/Yuras/gists{/gist_id}",
78      "starred_url": "https://api.github.com/users/Yuras/starred{/owner}{/repo}",
79      "subscriptions_url": "https://api.github.com/users/Yuras/subscriptions",
80      "organizations_url": "https://api.github.com/users/Yuras/orgs",
81      "repos_url": "https://api.github.com/users/Yuras/repos",
82      "events_url": "https://api.github.com/users/Yuras/events{/privacy}",
83      "received_events_url": "https://api.github.com/users/Yuras/received_events",
84      "type": "User",
85      "site_admin": false
86    },
87    "labels": [
88
89    ],
90    "state": "open",
91    "locked": false,
92    "assignee": null,
93    "assignees": [
94
95    ],
96    "milestone": null,
97    "comments": 4,
98    "created_at": "2020-04-04T11:05:26Z",
99    "updated_at": "2020-04-06T11:04:41Z",
100    "closed_at": null,
101    "author_association": "CONTRIBUTOR",
102    "pull_request": {
103      "url": "https://api.github.com/repos/bos/aeson/pulls/768",
104      "html_url": "https://github.com/bos/aeson/pull/768",
105      "diff_url": "https://github.com/bos/aeson/pull/768.diff",
106      "patch_url": "https://github.com/bos/aeson/pull/768.patch"
107    },
108    "body": "This PR replaces `attoparsec` with non-backtracking parser `scanner`, which improves performance by 20%-40% (see the benchmark results below.) It's WIP yet, I'd like to hear people's opinion on that.\r\n\r\n# Issues\r\n\r\nThere are two main issues with this change:\r\n\r\n## Backward compatibility\r\n\r\nSince `aeson` exposes `attoparsec` parses from `Data.Aeson.Parser` module, replacing implementation will affect the API.\r\n\r\nThe possible solution is to convert parser based on `scanner` to one based on `attoparsec` using `toAtto` combinator from [here](https://github.com/Yuras/scanner-attoparsec/commit/f7fff690f2e565d94005c26320bcb742d4efc22b#diff-61024a57a5b895c8501edc2950c22cf7R30). It requires [this PR](https://github.com/bos/attoparsec/pull/165) to be merged though. Note that `toAtto` preserves the speedup, i.e. parser implemented using `scanner` and then converted to `attoparsec` is still faster then one written directly in `attoparsec`.\r\n\r\nAlternatively we can expose both implementations for some period of time.\r\n\r\n## Error messages\r\n\r\nThe error messages from the new parser lacks context. Here is a fragment of the output from the `ErrorMessages` test case:\r\n\r\n```\r\n        --- Error in $: not enough input. Expecting ':'\r\n        --- Error in $: not enough input. Expecting object value\r\n        --- Error in $: not enough input. Expecting ',' or '}'\r\n        +++ Error in $: No more input\r\n        +++ Error in $: unexpected end of input\r\n        +++ Error in $: No more input\r\n```\r\n\r\nThe reason is that `scanner` doesn't have a combinator similar to `<?>` from `attoparsec`. It's possible to add it, but it affects performance negatively.\r\n\r\nNote that the error messages from `attoparsec` doesn't contain the error location, it makes them less useful. With `scanner` with [can add error location](https://github.com/Yuras/scanner/pull/12) to the error messages, it will make errors more useful.\r\n\r\n# Benchmarks\r\n\r\nI used the bench-parse.py for benchmarking. Here are the results on my computer. Before:\r\n\r\n```\r\n    json-data/twitter1.json :: 60000 times\r\n      0.626 seconds, 95806 parses/sec, 78.120 MB/sec\r\n    json-data/twitter1.json :: 60000 times\r\n      0.599 seconds, 100216 parses/sec, 81.716 MB/sec\r\n    json-data/twitter1.json :: 60000 times\r\n      0.614 seconds, 97689 parses/sec, 79.655 MB/sec\r\n0.8 KB: 100217 msg\\/sec (81.7 MB\\/sec)\r\n    json-data/twitter10.json :: 13000 times\r\n      0.636 seconds, 20430 parses/sec, 128.477 MB/sec\r\n    json-data/twitter10.json :: 13000 times\r\n      0.624 seconds, 20830 parses/sec, 130.995 MB/sec\r\n    json-data/twitter10.json :: 13000 times\r\n      0.637 seconds, 20412 parses/sec, 128.364 MB/sec\r\n6.4 KB: 20831 msg\\/sec (131.0 MB\\/sec)\r\n    json-data/twitter20.json :: 7500 times\r\n      0.763 seconds, 9823 parses/sec, 113.058 MB/sec\r\n    json-data/twitter20.json :: 7500 times\r\n      0.742 seconds, 10105 parses/sec, 116.303 MB/sec\r\n    json-data/twitter20.json :: 7500 times\r\n      0.742 seconds, 10103 parses/sec, 116.280 MB/sec\r\n11.8 KB: 10105 msg\\/sec (116.3 MB\\/sec)\r\n    json-data/twitter50.json :: 2500 times\r\n      0.699 seconds, 3575 parses/sec, 108.937 MB/sec\r\n    json-data/twitter50.json :: 2500 times\r\n      0.703 seconds, 3554 parses/sec, 108.313 MB/sec\r\n    json-data/twitter50.json :: 2500 times\r\n      0.706 seconds, 3540 parses/sec, 107.879 MB/sec\r\n31.2 KB: 3575 msg\\/sec (108.9 MB\\/sec)\r\n    json-data/twitter100.json :: 1000 times\r\n      0.662 seconds, 1509 parses/sec, 90.703 MB/sec\r\n    json-data/twitter100.json :: 1000 times\r\n      0.679 seconds, 1473 parses/sec, 88.514 MB/sec\r\n    json-data/twitter100.json :: 1000 times\r\n      0.653 seconds, 1530 parses/sec, 91.961 MB/sec\r\n61.5 KB: 1531 msg\\/sec (92.0 MB\\/sec)\r\n    json-data/jp10.json :: 4000 times\r\n      0.592 seconds, 6756 parses/sec, 96.536 MB/sec\r\n    json-data/jp10.json :: 4000 times\r\n      0.600 seconds, 6661 parses/sec, 95.192 MB/sec\r\n    json-data/jp10.json :: 4000 times\r\n      0.597 seconds, 6702 parses/sec, 95.772 MB/sec\r\n14.6 KB: 6756 msg\\/sec (96.5 MB\\/sec)\r\n    json-data/jp50.json :: 1200 times\r\n      0.644 seconds, 1862 parses/sec, 80.163 MB/sec\r\n    json-data/jp50.json :: 1200 times\r\n      0.627 seconds, 1914 parses/sec, 82.409 MB/sec\r\n    json-data/jp50.json :: 1200 times\r\n      0.646 seconds, 1858 parses/sec, 80.009 MB/sec\r\n44.1 KB: 1914 msg\\/sec (82.4 MB\\/sec)\r\n    json-data/jp100.json :: 700 times\r\n      0.743 seconds, 941 parses/sec, 76.231 MB/sec\r\n    json-data/jp100.json :: 700 times\r\n      0.745 seconds, 939 parses/sec, 76.063 MB/sec\r\n    json-data/jp100.json :: 700 times\r\n      0.747 seconds, 937 parses/sec, 75.874 MB/sec\r\n82.9 KB: 942 msg\\/sec (76.2 MB\\/sec)\r\n```\r\n\r\nAfter:\r\n\r\n```\r\n    json-data/twitter1.json :: 60000 times\r\n      0.488 seconds, 122874 parses/sec, 100.190 MB/sec\r\n    json-data/twitter1.json :: 60000 times\r\n      0.480 seconds, 125054 parses/sec, 101.969 MB/sec\r\n    json-data/twitter1.json :: 60000 times\r\n      0.478 seconds, 125445 parses/sec, 102.287 MB/sec\r\n0.8 KB: 125445 msg\\/sec (102.3 MB\\/sec)\r\n    json-data/twitter10.json :: 13000 times\r\n      0.459 seconds, 28311 parses/sec, 178.035 MB/sec\r\n    json-data/twitter10.json :: 13000 times\r\n      0.466 seconds, 27877 parses/sec, 175.307 MB/sec\r\n    json-data/twitter10.json :: 13000 times\r\n      0.462 seconds, 28159 parses/sec, 177.084 MB/sec\r\n6.4 KB: 28311 msg\\/sec (178.0 MB\\/sec)\r\n    json-data/twitter20.json :: 7500 times\r\n      0.533 seconds, 14079 parses/sec, 162.038 MB/sec\r\n    json-data/twitter20.json :: 7500 times\r\n      0.527 seconds, 14239 parses/sec, 163.882 MB/sec\r\n    json-data/twitter20.json :: 7500 times\r\n      0.526 seconds, 14248 parses/sec, 163.981 MB/sec\r\n11.8 KB: 14248 msg\\/sec (164.0 MB\\/sec)\r\n    json-data/twitter50.json :: 2500 times\r\n      0.498 seconds, 5019 parses/sec, 152.932 MB/sec\r\n    json-data/twitter50.json :: 2500 times\r\n      0.492 seconds, 5076 parses/sec, 154.690 MB/sec\r\n    json-data/twitter50.json :: 2500 times\r\n      0.496 seconds, 5035 parses/sec, 153.441 MB/sec\r\n31.2 KB: 5077 msg\\/sec (154.7 MB\\/sec)\r\n    json-data/twitter100.json :: 1000 times\r\n      0.464 seconds, 2153 parses/sec, 129.369 MB/sec\r\n    json-data/twitter100.json :: 1000 times\r\n      0.463 seconds, 2158 parses/sec, 129.672 MB/sec\r\n    json-data/twitter100.json :: 1000 times\r\n      0.463 seconds, 2158 parses/sec, 129.690 MB/sec\r\n61.5 KB: 2159 msg\\/sec (129.7 MB\\/sec)\r\n    json-data/jp10.json :: 4000 times\r\n      0.512 seconds, 7811 parses/sec, 111.625 MB/sec\r\n    json-data/jp10.json :: 4000 times\r\n      0.521 seconds, 7677 parses/sec, 109.707 MB/sec\r\n    json-data/jp10.json :: 4000 times\r\n      0.509 seconds, 7855 parses/sec, 112.243 MB/sec\r\n14.6 KB: 7855 msg\\/sec (112.2 MB\\/sec)\r\n    json-data/jp50.json :: 1200 times\r\n      0.519 seconds, 2313 parses/sec, 99.590 MB/sec\r\n    json-data/jp50.json :: 1200 times\r\n      0.540 seconds, 2222 parses/sec, 95.687 MB/sec\r\n    json-data/jp50.json :: 1200 times\r\n      0.522 seconds, 2299 parses/sec, 98.975 MB/sec\r\n44.1 KB: 2313 msg\\/sec (99.6 MB\\/sec)\r\n    json-data/jp100.json :: 700 times\r\n      0.623 seconds, 1123 parses/sec, 90.915 MB/sec\r\n    json-data/jp100.json :: 700 times\r\n      0.605 seconds, 1156 parses/sec, 93.613 MB/sec\r\n    json-data/jp100.json :: 700 times\r\n      0.600 seconds, 1166 parses/sec, 94.408 MB/sec\r\n82.9 KB: 1166 msg\\/sec (94.4 MB\\/sec)\r\n```\r\n\r\n"
109  },
110  {
111    "url": "https://api.github.com/repos/bos/aeson/issues/766",
112    "repository_url": "https://api.github.com/repos/bos/aeson",
113    "labels_url": "https://api.github.com/repos/bos/aeson/issues/766/labels{/name}",
114    "comments_url": "https://api.github.com/repos/bos/aeson/issues/766/comments",
115    "events_url": "https://api.github.com/repos/bos/aeson/issues/766/events",
116    "html_url": "https://github.com/bos/aeson/issues/766",
117    "id": 593293818,
118    "node_id": "MDU6SXNzdWU1OTMyOTM4MTg=",
119    "number": 766,
120    "title": "Cleanup benchmarks",
121    "user": {
122      "login": "phadej",
123      "id": 51087,
124      "node_id": "MDQ6VXNlcjUxMDg3",
125      "avatar_url": "https://avatars2.githubusercontent.com/u/51087?v=4",
126      "gravatar_id": "",
127      "url": "https://api.github.com/users/phadej",
128      "html_url": "https://github.com/phadej",
129      "followers_url": "https://api.github.com/users/phadej/followers",
130      "following_url": "https://api.github.com/users/phadej/following{/other_user}",
131      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",
132      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",
133      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",
134      "organizations_url": "https://api.github.com/users/phadej/orgs",
135      "repos_url": "https://api.github.com/users/phadej/repos",
136      "events_url": "https://api.github.com/users/phadej/events{/privacy}",
137      "received_events_url": "https://api.github.com/users/phadej/received_events",
138      "type": "User",
139      "site_admin": false
140    },
141    "labels": [
142
143    ],
144    "state": "open",
145    "locked": false,
146    "assignee": null,
147    "assignees": [
148
149    ],
150    "milestone": null,
151    "comments": 0,
152    "created_at": "2020-04-03T10:49:30Z",
153    "updated_at": "2020-04-03T10:49:30Z",
154    "closed_at": null,
155    "author_association": "CONTRIBUTOR",
156    "body": "- Make `cabal.benchmarks.project` without `aeson` library. This would allow to not recompile `criterion` all the time.\r\n- remove old python scripts\r\n- rather make a script which would allow comparing benchmarks using https://hackage.haskell.org/package/criterion-compare\r\n   - that script could run all benchmarks and collect their results, we have plenty of benchmarks for special cases\r\n- Add more examples than just Twitter. for example\r\n   -  GitHub issues listing\r\n   - https://openweathermap.org/api\r\n   - Some NPM package's `package.json` and or Cabal's `plan.json`"
157  },
158  {
159    "url": "https://api.github.com/repos/bos/aeson/issues/748",
160    "repository_url": "https://api.github.com/repos/bos/aeson",
161    "labels_url": "https://api.github.com/repos/bos/aeson/issues/748/labels{/name}",
162    "comments_url": "https://api.github.com/repos/bos/aeson/issues/748/comments",
163    "events_url": "https://api.github.com/repos/bos/aeson/issues/748/events",
164    "html_url": "https://github.com/bos/aeson/issues/748",
165    "id": 555921820,
166    "node_id": "MDU6SXNzdWU1NTU5MjE4MjA=",
167    "number": 748,
168    "title": "how to parse json with field of optional and variant type in Haskell?",
169    "user": {
170      "login": "chakpongchung",
171      "id": 8110904,
172      "node_id": "MDQ6VXNlcjgxMTA5MDQ=",
173      "avatar_url": "https://avatars0.githubusercontent.com/u/8110904?v=4",
174      "gravatar_id": "",
175      "url": "https://api.github.com/users/chakpongchung",
176      "html_url": "https://github.com/chakpongchung",
177      "followers_url": "https://api.github.com/users/chakpongchung/followers",
178      "following_url": "https://api.github.com/users/chakpongchung/following{/other_user}",
179      "gists_url": "https://api.github.com/users/chakpongchung/gists{/gist_id}",
180      "starred_url": "https://api.github.com/users/chakpongchung/starred{/owner}{/repo}",
181      "subscriptions_url": "https://api.github.com/users/chakpongchung/subscriptions",
182      "organizations_url": "https://api.github.com/users/chakpongchung/orgs",
183      "repos_url": "https://api.github.com/users/chakpongchung/repos",
184      "events_url": "https://api.github.com/users/chakpongchung/events{/privacy}",
185      "received_events_url": "https://api.github.com/users/chakpongchung/received_events",
186      "type": "User",
187      "site_admin": false
188    },
189    "labels": [
190
191    ],
192    "state": "open",
193    "locked": false,
194    "assignee": null,
195    "assignees": [
196
197    ],
198    "milestone": null,
199    "comments": 0,
200    "created_at": "2020-01-28T00:52:43Z",
201    "updated_at": "2020-01-28T00:52:43Z",
202    "closed_at": null,
203    "author_association": "NONE",
204    "body": "https://stackoverflow.com/questions/59903779/how-to-parse-json-with-field-of-optional-and-variant-type-in-haskell\r\n\r\nI looked at the Twitter example in this repo. Is it a working example? If so, where can I find its corresponding json? Though I am not sure that twitter example cover the features needed to parse the full example(not the minimal) shown in the link above.\r\n\r\n"
205  },
206  {
207    "url": "https://api.github.com/repos/bos/aeson/issues/747",
208    "repository_url": "https://api.github.com/repos/bos/aeson",
209    "labels_url": "https://api.github.com/repos/bos/aeson/issues/747/labels{/name}",
210    "comments_url": "https://api.github.com/repos/bos/aeson/issues/747/comments",
211    "events_url": "https://api.github.com/repos/bos/aeson/issues/747/events",
212    "html_url": "https://github.com/bos/aeson/issues/747",
213    "id": 552518278,
214    "node_id": "MDU6SXNzdWU1NTI1MTgyNzg=",
215    "number": 747,
216    "title": "Add a data type and `FromJSON` instance that retains the original JSON",
217    "user": {
218      "login": "TomMD",
219      "id": 137806,
220      "node_id": "MDQ6VXNlcjEzNzgwNg==",
221      "avatar_url": "https://avatars2.githubusercontent.com/u/137806?v=4",
222      "gravatar_id": "",
223      "url": "https://api.github.com/users/TomMD",
224      "html_url": "https://github.com/TomMD",
225      "followers_url": "https://api.github.com/users/TomMD/followers",
226      "following_url": "https://api.github.com/users/TomMD/following{/other_user}",
227      "gists_url": "https://api.github.com/users/TomMD/gists{/gist_id}",
228      "starred_url": "https://api.github.com/users/TomMD/starred{/owner}{/repo}",
229      "subscriptions_url": "https://api.github.com/users/TomMD/subscriptions",
230      "organizations_url": "https://api.github.com/users/TomMD/orgs",
231      "repos_url": "https://api.github.com/users/TomMD/repos",
232      "events_url": "https://api.github.com/users/TomMD/events{/privacy}",
233      "received_events_url": "https://api.github.com/users/TomMD/received_events",
234      "type": "User",
235      "site_admin": false
236    },
237    "labels": [
238
239    ],
240    "state": "open",
241    "locked": false,
242    "assignee": null,
243    "assignees": [
244
245    ],
246    "milestone": null,
247    "comments": 2,
248    "created_at": "2020-01-20T21:34:42Z",
249    "updated_at": "2020-01-21T10:17:08Z",
250    "closed_at": null,
251    "author_association": "CONTRIBUTOR",
252    "body": "With many APIs the Haskell types and the real world get out of sync.  Updating the types is time consuming and often requires human interaction (because of separate packages, maintainers).  For example, the GitHub API has lots of nooks that aren't reflected in the quite-rich (and appreciated) github package.  For these cases I find it helpful to have access to the raw JSON both for debugging and for supporting functionality until the next release.\r\n\r\nTo restate, having a type decoded from an Aeson Value does not negate the utility of having the original Aeson Value around.  This is a common situation and to support it I propose we add a type and `FromJSON` instance of:\r\n\r\n```\r\nmodule M (RetainedJSON, retainedJSON, decodedJSON) where\r\ndata RetainedJSON a = RetainedJSON\r\n    { retainedJSON :: Value\r\n    , decodedJSON :: a\r\n    }\r\n\r\ninstance FromJSON a => FromJSON (RetainedJSON a) where\r\n    parseJSON x = RetainedJSON x <$> parseJSON x\r\n```\r\n\r\nAnd either omit the `ToJSON` instance or use the admittedly-controversial instance of:\r\n\r\n```\r\ninstance ToJSON (RetainedJSON a) where\r\n    toJSON = pure . retainedJSON\r\n```\r\n\r\nI'm checking for strong opinions against this proposal before I make a PR.  Anyone have thoughts?"
253  },
254  {
255    "url": "https://api.github.com/repos/bos/aeson/issues/744",
256    "repository_url": "https://api.github.com/repos/bos/aeson",
257    "labels_url": "https://api.github.com/repos/bos/aeson/issues/744/labels{/name}",
258    "comments_url": "https://api.github.com/repos/bos/aeson/issues/744/comments",
259    "events_url": "https://api.github.com/repos/bos/aeson/issues/744/events",
260    "html_url": "https://github.com/bos/aeson/issues/744",
261    "id": 536970276,
262    "node_id": "MDU6SXNzdWU1MzY5NzAyNzY=",
263    "number": 744,
264    "title": "Decode null to ()",
265    "user": {
266      "login": "domenkozar",
267      "id": 126339,
268      "node_id": "MDQ6VXNlcjEyNjMzOQ==",
269      "avatar_url": "https://avatars2.githubusercontent.com/u/126339?v=4",
270      "gravatar_id": "",
271      "url": "https://api.github.com/users/domenkozar",
272      "html_url": "https://github.com/domenkozar",
273      "followers_url": "https://api.github.com/users/domenkozar/followers",
274      "following_url": "https://api.github.com/users/domenkozar/following{/other_user}",
275      "gists_url": "https://api.github.com/users/domenkozar/gists{/gist_id}",
276      "starred_url": "https://api.github.com/users/domenkozar/starred{/owner}{/repo}",
277      "subscriptions_url": "https://api.github.com/users/domenkozar/subscriptions",
278      "organizations_url": "https://api.github.com/users/domenkozar/orgs",
279      "repos_url": "https://api.github.com/users/domenkozar/repos",
280      "events_url": "https://api.github.com/users/domenkozar/events{/privacy}",
281      "received_events_url": "https://api.github.com/users/domenkozar/received_events",
282      "type": "User",
283      "site_admin": false
284    },
285    "labels": [
286
287    ],
288    "state": "open",
289    "locked": false,
290    "assignee": null,
291    "assignees": [
292
293    ],
294    "milestone": null,
295    "comments": 3,
296    "created_at": "2019-12-12T13:13:33Z",
297    "updated_at": "2019-12-12T13:32:44Z",
298    "closed_at": null,
299    "author_association": "NONE",
300    "body": "Sometimes you always expect `null` in a certain field and it would be great if that could get decoded to `()`."
301  },
302  {
303    "url": "https://api.github.com/repos/bos/aeson/issues/733",
304    "repository_url": "https://api.github.com/repos/bos/aeson",
305    "labels_url": "https://api.github.com/repos/bos/aeson/issues/733/labels{/name}",
306    "comments_url": "https://api.github.com/repos/bos/aeson/issues/733/comments",
307    "events_url": "https://api.github.com/repos/bos/aeson/issues/733/events",
308    "html_url": "https://github.com/bos/aeson/issues/733",
309    "id": 506387744,
310    "node_id": "MDU6SXNzdWU1MDYzODc3NDQ=",
311    "number": 733,
312    "title": "Development Workflow",
313    "user": {
314      "login": "gdevanla",
315      "id": 1274371,
316      "node_id": "MDQ6VXNlcjEyNzQzNzE=",
317      "avatar_url": "https://avatars0.githubusercontent.com/u/1274371?v=4",
318      "gravatar_id": "",
319      "url": "https://api.github.com/users/gdevanla",
320      "html_url": "https://github.com/gdevanla",
321      "followers_url": "https://api.github.com/users/gdevanla/followers",
322      "following_url": "https://api.github.com/users/gdevanla/following{/other_user}",
323      "gists_url": "https://api.github.com/users/gdevanla/gists{/gist_id}",
324      "starred_url": "https://api.github.com/users/gdevanla/starred{/owner}{/repo}",
325      "subscriptions_url": "https://api.github.com/users/gdevanla/subscriptions",
326      "organizations_url": "https://api.github.com/users/gdevanla/orgs",
327      "repos_url": "https://api.github.com/users/gdevanla/repos",
328      "events_url": "https://api.github.com/users/gdevanla/events{/privacy}",
329      "received_events_url": "https://api.github.com/users/gdevanla/received_events",
330      "type": "User",
331      "site_admin": false
332    },
333    "labels": [
334
335    ],
336    "state": "open",
337    "locked": false,
338    "assignee": null,
339    "assignees": [
340
341    ],
342    "milestone": null,
343    "comments": 10,
344    "created_at": "2019-10-13T21:56:41Z",
345    "updated_at": "2019-10-16T13:35:35Z",
346    "closed_at": null,
347    "author_association": "CONTRIBUTOR",
348    "body": "One challenge I have had while making incremental changes to the code base was that running `stack build` or `stack test` takes a while. What is the workflow other contributors follow in these scenarios?  \r\n\r\nAt the least, when I run `stack test`, I would like to have a way to just run specific tests or just tests within a particular scope. Currently, when I run `stack test`,a lot of time is spent in building libraries like `criterion` and 'statistics`. Is there a way to turn them off as needed.\r\n\r\nOverall, I would like to contribute to a document (assuming this is not there already) that describes a development workflow which other contributors could use.  Can someone point me to any resources or share their workflow. I can create a document by compiling those."
349  },
350  {
351    "url": "https://api.github.com/repos/bos/aeson/issues/724",
352    "repository_url": "https://api.github.com/repos/bos/aeson",
353    "labels_url": "https://api.github.com/repos/bos/aeson/issues/724/labels{/name}",
354    "comments_url": "https://api.github.com/repos/bos/aeson/issues/724/comments",
355    "events_url": "https://api.github.com/repos/bos/aeson/issues/724/events",
356    "html_url": "https://github.com/bos/aeson/issues/724",
357    "id": 482230210,
358    "node_id": "MDU6SXNzdWU0ODIyMzAyMTA=",
359    "number": 724,
360    "title": "Add default wrapper",
361    "user": {
362      "login": "treeowl",
363      "id": 1893117,
364      "node_id": "MDQ6VXNlcjE4OTMxMTc=",
365      "avatar_url": "https://avatars2.githubusercontent.com/u/1893117?v=4",
366      "gravatar_id": "",
367      "url": "https://api.github.com/users/treeowl",
368      "html_url": "https://github.com/treeowl",
369      "followers_url": "https://api.github.com/users/treeowl/followers",
370      "following_url": "https://api.github.com/users/treeowl/following{/other_user}",
371      "gists_url": "https://api.github.com/users/treeowl/gists{/gist_id}",
372      "starred_url": "https://api.github.com/users/treeowl/starred{/owner}{/repo}",
373      "subscriptions_url": "https://api.github.com/users/treeowl/subscriptions",
374      "organizations_url": "https://api.github.com/users/treeowl/orgs",
375      "repos_url": "https://api.github.com/users/treeowl/repos",
376      "events_url": "https://api.github.com/users/treeowl/events{/privacy}",
377      "received_events_url": "https://api.github.com/users/treeowl/received_events",
378      "type": "User",
379      "site_admin": false
380    },
381    "labels": [
382
383    ],
384    "state": "open",
385    "locked": false,
386    "assignee": null,
387    "assignees": [
388
389    ],
390    "milestone": null,
391    "comments": 2,
392    "created_at": "2019-08-19T10:27:18Z",
393    "updated_at": "2019-09-04T19:54:59Z",
394    "closed_at": null,
395    "author_association": "NONE",
396    "body": "```haskell\r\nnewtype DefaultJSON a = DefaultJSON a\r\n\r\ninstance (Generic a, GToJSON Zero (Rep a), GToEncoding Zero (Rep a))\r\n    => ToJSON (DefaultJSON a) where\r\n  toJSON (DefaultJSON a) = genericToJSON defaultOptions a\r\n  toEncoding (DefaultJSON a) = genericToEncoding defaultOptions a\r\n\r\ninstance (Generic a, GFromJSON Zero (Rep a)) => FromJSON (DefaultJSON a) where\r\n  parseJSON x = DefaultJSON <$> genericParseJSON defaultOptions x\r\n```\r\n\r\nThis can be used with `DerivingVia`:\r\n\r\n```haskell\r\ndata Message val = Message {val :: val, teamId :: Int, messageType :: Char}\r\n  deriving Generic\r\n  deriving (ToJSON, FromJSON) via DefaultJSON (Message val)\r\n```\r\n\r\nThis is almost as easy as writing empty instances, but it includes the `toEncoding` optimization for `ToJSON`."
397  },
398  {
399    "url": "https://api.github.com/repos/bos/aeson/issues/720",
400    "repository_url": "https://api.github.com/repos/bos/aeson",
401    "labels_url": "https://api.github.com/repos/bos/aeson/issues/720/labels{/name}",
402    "comments_url": "https://api.github.com/repos/bos/aeson/issues/720/comments",
403    "events_url": "https://api.github.com/repos/bos/aeson/issues/720/events",
404    "html_url": "https://github.com/bos/aeson/issues/720",
405    "id": 473768871,
406    "node_id": "MDU6SXNzdWU0NzM3Njg4NzE=",
407    "number": 720,
408    "title": "Unexpected behaviour with Maybe typed fields and UntaggedValue",
409    "user": {
410      "login": "edwardb96",
411      "id": 8405233,
412      "node_id": "MDQ6VXNlcjg0MDUyMzM=",
413      "avatar_url": "https://avatars3.githubusercontent.com/u/8405233?v=4",
414      "gravatar_id": "",
415      "url": "https://api.github.com/users/edwardb96",
416      "html_url": "https://github.com/edwardb96",
417      "followers_url": "https://api.github.com/users/edwardb96/followers",
418      "following_url": "https://api.github.com/users/edwardb96/following{/other_user}",
419      "gists_url": "https://api.github.com/users/edwardb96/gists{/gist_id}",
420      "starred_url": "https://api.github.com/users/edwardb96/starred{/owner}{/repo}",
421      "subscriptions_url": "https://api.github.com/users/edwardb96/subscriptions",
422      "organizations_url": "https://api.github.com/users/edwardb96/orgs",
423      "repos_url": "https://api.github.com/users/edwardb96/repos",
424      "events_url": "https://api.github.com/users/edwardb96/events{/privacy}",
425      "received_events_url": "https://api.github.com/users/edwardb96/received_events",
426      "type": "User",
427      "site_admin": false
428    },
429    "labels": [
430
431    ],
432    "state": "open",
433    "locked": false,
434    "assignee": null,
435    "assignees": [
436
437    ],
438    "milestone": null,
439    "comments": 1,
440    "created_at": "2019-07-28T17:49:45Z",
441    "updated_at": "2019-07-28T19:41:21Z",
442    "closed_at": null,
443    "author_association": "NONE",
444    "body": "I'm not sure if this is a bug or a feature so I thought I'd check. Here is a minimal working example.\r\n\r\n```haskell\r\n{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}\r\nimport Data.Aeson\r\nimport Data.Aeson.TH\r\n\r\ndata Fruit = Apple { a :: Integer, b :: Maybe Bool }\r\n           | Banana { a :: Integer }\r\n           deriving Show\r\n$(deriveJSON defaultOptions { sumEncoding = UntaggedValue } 'Apple)\r\n\r\nmain :: IO ()\r\nmain = \r\n  do\r\n    putStrLn $ show (decode \"{ \\\"a\\\": 10 }\" :: Maybe Fruit) \r\n    -- Expected Just (Banana {a = 10}), got Just (Apple {a = 10, b = Nothing})\r\n    putStrLn $ show (decode \"{ \\\"a\\\": 10, \\\"b\\\": true }\" :: Maybe Fruit) \r\n    -- Should be and got Just (Apple {a = 10, b = Just True}) \r\n\r\n```\r\n\r\nSince the `omitNothingFields` is `False` by default, and when it is false `Nothing`s are encoded as `null` (rather than omitted). I'd expect `{ \"a\": 10 }` to decode as a `Banana`.\r\n\r\nLikewise when `omitNothingFields` is false I'd expect to get `Nothing` for the following example.\r\n\r\n```haskell \r\n{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}\r\nimport Data.Aeson\r\nimport Data.Aeson.TH\r\n\r\ndata Fruit = Apple { a :: Integer, b :: Maybe Bool }\r\n           deriving Show\r\n$(deriveJSON defaultOptions 'Apple)\r\n\r\nmain :: IO ()\r\nmain = \r\n  do\r\n    putStrLn $ show (decode \"{ \\\"a\\\": 10 }\" :: Maybe Fruit) -- Expected Nothing, got (Apple { a = 10, b = Nothing})\r\n```\r\nI expect this is a design choice rather than a bug, If this is the case perhaps it could be documented more clearly or highlighted in the documentation for `UntaggedValue` e.g.\r\n\r\n> Note: Since omitted `Maybe` typed fields decode to `Nothing`, the set of non-maybe fields from each constructor should be disjoint. \r\n\r\nIf this is indeed a bug, I have hacked together a [patch](https://gist.github.com/edwardb96/aa9cefde626a5141b2cf28ce3c1a7962) for my own purposes but would be happy to tidy it up and turn it into a PR."
445  },
446  {
447    "url": "https://api.github.com/repos/bos/aeson/issues/704",
448    "repository_url": "https://api.github.com/repos/bos/aeson",
449    "labels_url": "https://api.github.com/repos/bos/aeson/issues/704/labels{/name}",
450    "comments_url": "https://api.github.com/repos/bos/aeson/issues/704/comments",
451    "events_url": "https://api.github.com/repos/bos/aeson/issues/704/events",
452    "html_url": "https://github.com/bos/aeson/issues/704",
453    "id": 449409556,
454    "node_id": "MDU6SXNzdWU0NDk0MDk1NTY=",
455    "number": 704,
456    "title": "Ord instance for Value?",
457    "user": {
458      "login": "Gabriel439",
459      "id": 1313787,
460      "node_id": "MDQ6VXNlcjEzMTM3ODc=",
461      "avatar_url": "https://avatars3.githubusercontent.com/u/1313787?v=4",
462      "gravatar_id": "",
463      "url": "https://api.github.com/users/Gabriel439",
464      "html_url": "https://github.com/Gabriel439",
465      "followers_url": "https://api.github.com/users/Gabriel439/followers",
466      "following_url": "https://api.github.com/users/Gabriel439/following{/other_user}",
467      "gists_url": "https://api.github.com/users/Gabriel439/gists{/gist_id}",
468      "starred_url": "https://api.github.com/users/Gabriel439/starred{/owner}{/repo}",
469      "subscriptions_url": "https://api.github.com/users/Gabriel439/subscriptions",
470      "organizations_url": "https://api.github.com/users/Gabriel439/orgs",
471      "repos_url": "https://api.github.com/users/Gabriel439/repos",
472      "events_url": "https://api.github.com/users/Gabriel439/events{/privacy}",
473      "received_events_url": "https://api.github.com/users/Gabriel439/received_events",
474      "type": "User",
475      "site_admin": false
476    },
477    "labels": [
478
479    ],
480    "state": "open",
481    "locked": false,
482    "assignee": null,
483    "assignees": [
484
485    ],
486    "milestone": null,
487    "comments": 17,
488    "created_at": "2019-05-28T18:16:49Z",
489    "updated_at": "2019-12-06T17:01:40Z",
490    "closed_at": null,
491    "author_association": "NONE",
492    "body": "I could add an `Ord` instance for `Value` if it would be welcome.  The context for this to be able to store `Value`s inside of a `Set`"
493  },
494  {
495    "url": "https://api.github.com/repos/bos/aeson/issues/700",
496    "repository_url": "https://api.github.com/repos/bos/aeson",
497    "labels_url": "https://api.github.com/repos/bos/aeson/issues/700/labels{/name}",
498    "comments_url": "https://api.github.com/repos/bos/aeson/issues/700/comments",
499    "events_url": "https://api.github.com/repos/bos/aeson/issues/700/events",
500    "html_url": "https://github.com/bos/aeson/issues/700",
501    "id": 443832632,
502    "node_id": "MDU6SXNzdWU0NDM4MzI2MzI=",
503    "number": 700,
504    "title": "Expose GToJSON",
505    "user": {
506      "login": "LukaHorvat",
507      "id": 370627,
508      "node_id": "MDQ6VXNlcjM3MDYyNw==",
509      "avatar_url": "https://avatars0.githubusercontent.com/u/370627?v=4",
510      "gravatar_id": "",
511      "url": "https://api.github.com/users/LukaHorvat",
512      "html_url": "https://github.com/LukaHorvat",
513      "followers_url": "https://api.github.com/users/LukaHorvat/followers",
514      "following_url": "https://api.github.com/users/LukaHorvat/following{/other_user}",
515      "gists_url": "https://api.github.com/users/LukaHorvat/gists{/gist_id}",
516      "starred_url": "https://api.github.com/users/LukaHorvat/starred{/owner}{/repo}",
517      "subscriptions_url": "https://api.github.com/users/LukaHorvat/subscriptions",
518      "organizations_url": "https://api.github.com/users/LukaHorvat/orgs",
519      "repos_url": "https://api.github.com/users/LukaHorvat/repos",
520      "events_url": "https://api.github.com/users/LukaHorvat/events{/privacy}",
521      "received_events_url": "https://api.github.com/users/LukaHorvat/received_events",
522      "type": "User",
523      "site_admin": false
524    },
525    "labels": [
526
527    ],
528    "state": "open",
529    "locked": false,
530    "assignee": null,
531    "assignees": [
532
533    ],
534    "milestone": null,
535    "comments": 6,
536    "created_at": "2019-05-14T10:21:04Z",
537    "updated_at": "2019-07-28T22:56:05Z",
538    "closed_at": null,
539    "author_association": "NONE",
540    "body": "Currently, only `GFromJSON` is exposed. `GToJSON` is only exposed via the two type synonyms which means that I can't write custom instances for that class. My use case is that I have a type (`data Unset = Unset`) that I want to use for some fields in a record and I want those fields to be dropped from the JSON representation of that record. If `GToJSON` was exposed, I could just duplicate the trick used for `Maybe`. \r\n\r\nSince `GFromJSON` is already exposed, this already has a precedent."
541  },
542  {
543    "url": "https://api.github.com/repos/bos/aeson/issues/694",
544    "repository_url": "https://api.github.com/repos/bos/aeson",
545    "labels_url": "https://api.github.com/repos/bos/aeson/issues/694/labels{/name}",
546    "comments_url": "https://api.github.com/repos/bos/aeson/issues/694/comments",
547    "events_url": "https://api.github.com/repos/bos/aeson/issues/694/events",
548    "html_url": "https://github.com/bos/aeson/pull/694",
549    "id": 433347757,
550    "node_id": "MDExOlB1bGxSZXF1ZXN0MjcwNTY4NzM5",
551    "number": 694,
552    "title": "Export isEmptyArray from Data.Aeson.Types",
553    "user": {
554      "login": "callummance",
555      "id": 4654774,
556      "node_id": "MDQ6VXNlcjQ2NTQ3NzQ=",
557      "avatar_url": "https://avatars1.githubusercontent.com/u/4654774?v=4",
558      "gravatar_id": "",
559      "url": "https://api.github.com/users/callummance",
560      "html_url": "https://github.com/callummance",
561      "followers_url": "https://api.github.com/users/callummance/followers",
562      "following_url": "https://api.github.com/users/callummance/following{/other_user}",
563      "gists_url": "https://api.github.com/users/callummance/gists{/gist_id}",
564      "starred_url": "https://api.github.com/users/callummance/starred{/owner}{/repo}",
565      "subscriptions_url": "https://api.github.com/users/callummance/subscriptions",
566      "organizations_url": "https://api.github.com/users/callummance/orgs",
567      "repos_url": "https://api.github.com/users/callummance/repos",
568      "events_url": "https://api.github.com/users/callummance/events{/privacy}",
569      "received_events_url": "https://api.github.com/users/callummance/received_events",
570      "type": "User",
571      "site_admin": false
572    },
573    "labels": [
574
575    ],
576    "state": "open",
577    "locked": false,
578    "assignee": null,
579    "assignees": [
580
581    ],
582    "milestone": null,
583    "comments": 1,
584    "created_at": "2019-04-15T15:32:42Z",
585    "updated_at": "2019-04-23T16:05:39Z",
586    "closed_at": null,
587    "author_association": "NONE",
588    "pull_request": {
589      "url": "https://api.github.com/repos/bos/aeson/pulls/694",
590      "html_url": "https://github.com/bos/aeson/pull/694",
591      "diff_url": "https://github.com/bos/aeson/pull/694.diff",
592      "patch_url": "https://github.com/bos/aeson/pull/694.patch"
593    },
594    "body": "Export `isEmptyArray` found in Data.Aeson.Types.Internal from Data.Aeson.Types. "
595  },
596  {
597    "url": "https://api.github.com/repos/bos/aeson/issues/693",
598    "repository_url": "https://api.github.com/repos/bos/aeson",
599    "labels_url": "https://api.github.com/repos/bos/aeson/issues/693/labels{/name}",
600    "comments_url": "https://api.github.com/repos/bos/aeson/issues/693/comments",
601    "events_url": "https://api.github.com/repos/bos/aeson/issues/693/events",
602    "html_url": "https://github.com/bos/aeson/issues/693",
603    "id": 428959371,
604    "node_id": "MDU6SXNzdWU0Mjg5NTkzNzE=",
605    "number": 693,
606    "title": "Committed choice for parsing Objects",
607    "user": {
608      "login": "robrix",
609      "id": 59671,
610      "node_id": "MDQ6VXNlcjU5Njcx",
611      "avatar_url": "https://avatars0.githubusercontent.com/u/59671?v=4",
612      "gravatar_id": "",
613      "url": "https://api.github.com/users/robrix",
614      "html_url": "https://github.com/robrix",
615      "followers_url": "https://api.github.com/users/robrix/followers",
616      "following_url": "https://api.github.com/users/robrix/following{/other_user}",
617      "gists_url": "https://api.github.com/users/robrix/gists{/gist_id}",
618      "starred_url": "https://api.github.com/users/robrix/starred{/owner}{/repo}",
619      "subscriptions_url": "https://api.github.com/users/robrix/subscriptions",
620      "organizations_url": "https://api.github.com/users/robrix/orgs",
621      "repos_url": "https://api.github.com/users/robrix/repos",
622      "events_url": "https://api.github.com/users/robrix/events{/privacy}",
623      "received_events_url": "https://api.github.com/users/robrix/received_events",
624      "type": "User",
625      "site_admin": true
626    },
627    "labels": [
628
629    ],
630    "state": "open",
631    "locked": false,
632    "assignee": null,
633    "assignees": [
634
635    ],
636    "milestone": null,
637    "comments": 1,
638    "created_at": "2019-04-03T20:27:00Z",
639    "updated_at": "2019-04-03T22:47:59Z",
640    "closed_at": null,
641    "author_association": "NONE",
642    "body": "Is there an idiomatic way to do committed choice when parsing an `Object`? E.g. we are parsing a structure which always has fields `a` and `b`, and may have `c`, `d`, or neither. Our naïve parser looks something like:\r\n\r\n```haskell\r\nparseJSON (Object v) = do\r\n  a <- v .: \"a\"\r\n  b <- v .: \"b\"\r\n  C a b <$> v .: \"c\" <|> D a b <$> v .: \"d\" <|> pure (E a b)\r\n```\r\n\r\nUnfortunately, if parsing the values in `c` or `d` fails, we’ll silently discard the failures and fall back to the `E` case. Instead, we’d like to commit to parsing a `C` as soon as we see the `c` key, or a `D` as soon as we see the `d` key, and only parse the `E` if neither key exists.\r\n\r\nIn `trifecta` (for example), choices are committed by default, and can only be backtracked past with `try`; but there doesn’t seem to be an inverse `commit` operator in `aeson` (at least, not that I’ve found thus far). Our current approach is therefore agonizingly manual:\r\n\r\n```haskell\r\nparseJSON (Object v) = do\r\n  a <- v .: \"a\"\r\n  b <- v .: \"b\"\r\n  c <- v .:? \"c\"\r\n  case c of\r\n    Just c  -> pure (C a b c)\r\n    Nothing -> do\r\n      d <- v .:? \"d\"\r\n      case d of\r\n        Just d  -> pure (D a b d)\r\n        Nothing -> pure (E a b)\r\n```\r\n\r\nIs there a better way to implement this sort of choice?\r\n\r\ncc @aymannadeem"
643  },
644  {
645    "url": "https://api.github.com/repos/bos/aeson/issues/687",
646    "repository_url": "https://api.github.com/repos/bos/aeson",
647    "labels_url": "https://api.github.com/repos/bos/aeson/issues/687/labels{/name}",
648    "comments_url": "https://api.github.com/repos/bos/aeson/issues/687/comments",
649    "events_url": "https://api.github.com/repos/bos/aeson/issues/687/events",
650    "html_url": "https://github.com/bos/aeson/issues/687",
651    "id": 417900732,
652    "node_id": "MDU6SXNzdWU0MTc5MDA3MzI=",
653    "number": 687,
654    "title": "Derived ToJSON1 instance does not respect omitNothingFields = True",
655    "user": {
656      "login": "ejconlon",
657      "id": 37287,
658      "node_id": "MDQ6VXNlcjM3Mjg3",
659      "avatar_url": "https://avatars2.githubusercontent.com/u/37287?v=4",
660      "gravatar_id": "",
661      "url": "https://api.github.com/users/ejconlon",
662      "html_url": "https://github.com/ejconlon",
663      "followers_url": "https://api.github.com/users/ejconlon/followers",
664      "following_url": "https://api.github.com/users/ejconlon/following{/other_user}",
665      "gists_url": "https://api.github.com/users/ejconlon/gists{/gist_id}",
666      "starred_url": "https://api.github.com/users/ejconlon/starred{/owner}{/repo}",
667      "subscriptions_url": "https://api.github.com/users/ejconlon/subscriptions",
668      "organizations_url": "https://api.github.com/users/ejconlon/orgs",
669      "repos_url": "https://api.github.com/users/ejconlon/repos",
670      "events_url": "https://api.github.com/users/ejconlon/events{/privacy}",
671      "received_events_url": "https://api.github.com/users/ejconlon/received_events",
672      "type": "User",
673      "site_admin": false
674    },
675    "labels": [
676
677    ],
678    "state": "open",
679    "locked": false,
680    "assignee": null,
681    "assignees": [
682
683    ],
684    "milestone": null,
685    "comments": 8,
686    "created_at": "2019-03-06T16:38:45Z",
687    "updated_at": "2019-03-14T11:43:13Z",
688    "closed_at": null,
689    "author_association": "NONE",
690    "body": "For an instance\r\n\r\n```\r\ndata C a = C { required :: a, optional :: Maybe a }\r\n    deriving (Eq, Show, Generic1)\r\n    deriving (ToJSON1) via (AesonWrapper1 C)\r\n```\r\n\r\nwith a simple deriving via newtype wrapper `AesonWrapper1` I am seeing the value `C 1 Nothing` serialize with `null`\r\n\r\n```\r\n        Example test case: FAIL\r\n          Repro.hs:77:\r\n          expected: \"{\\\"required\\\":1}\"\r\n           but got: \"{\\\"required\\\":1,\\\"optional\\\":null}\"\r\n```\r\n\r\nSee https://gist.github.com/ejconlon/30dc50b183a0f72501c3e49ce57cae52 for a self-contained repro."
691  },
692  {
693    "url": "https://api.github.com/repos/bos/aeson/issues/685",
694    "repository_url": "https://api.github.com/repos/bos/aeson",
695    "labels_url": "https://api.github.com/repos/bos/aeson/issues/685/labels{/name}",
696    "comments_url": "https://api.github.com/repos/bos/aeson/issues/685/comments",
697    "events_url": "https://api.github.com/repos/bos/aeson/issues/685/events",
698    "html_url": "https://github.com/bos/aeson/issues/685",
699    "id": 408401800,
700    "node_id": "MDU6SXNzdWU0MDg0MDE4MDA=",
701    "number": 685,
702    "title": "Feature request: a function to run Parser without pass-through",
703    "user": {
704      "login": "fumieval",
705      "id": 761865,
706      "node_id": "MDQ6VXNlcjc2MTg2NQ==",
707      "avatar_url": "https://avatars0.githubusercontent.com/u/761865?v=4",
708      "gravatar_id": "",
709      "url": "https://api.github.com/users/fumieval",
710      "html_url": "https://github.com/fumieval",
711      "followers_url": "https://api.github.com/users/fumieval/followers",
712      "following_url": "https://api.github.com/users/fumieval/following{/other_user}",
713      "gists_url": "https://api.github.com/users/fumieval/gists{/gist_id}",
714      "starred_url": "https://api.github.com/users/fumieval/starred{/owner}{/repo}",
715      "subscriptions_url": "https://api.github.com/users/fumieval/subscriptions",
716      "organizations_url": "https://api.github.com/users/fumieval/orgs",
717      "repos_url": "https://api.github.com/users/fumieval/repos",
718      "events_url": "https://api.github.com/users/fumieval/events{/privacy}",
719      "received_events_url": "https://api.github.com/users/fumieval/received_events",
720      "type": "User",
721      "site_admin": false
722    },
723    "labels": [
724
725    ],
726    "state": "open",
727    "locked": false,
728    "assignee": null,
729    "assignees": [
730
731    ],
732    "milestone": null,
733    "comments": 1,
734    "created_at": "2019-02-09T05:45:49Z",
735    "updated_at": "2019-02-09T06:04:57Z",
736    "closed_at": null,
737    "author_association": "NONE",
738    "body": "I frequently end up writing `flip J.parseEither () $ const $ do ...`. The following function would be very useful:\r\n\r\n```haskell\r\nexecParser :: Parser a -> Either String a\r\nexecParser m = runParser m [] onError Right\r\n  where onError path msg = Left (formatError path msg)\r\n```"
739  },
740  {
741    "url": "https://api.github.com/repos/bos/aeson/issues/683",
742    "repository_url": "https://api.github.com/repos/bos/aeson",
743    "labels_url": "https://api.github.com/repos/bos/aeson/issues/683/labels{/name}",
744    "comments_url": "https://api.github.com/repos/bos/aeson/issues/683/comments",
745    "events_url": "https://api.github.com/repos/bos/aeson/issues/683/events",
746    "html_url": "https://github.com/bos/aeson/issues/683",
747    "id": 393410619,
748    "node_id": "MDU6SXNzdWUzOTM0MTA2MTk=",
749    "number": 683,
750    "title": "Custom error type",
751    "user": {
752      "login": "asheshambasta",
753      "id": 580365,
754      "node_id": "MDQ6VXNlcjU4MDM2NQ==",
755      "avatar_url": "https://avatars3.githubusercontent.com/u/580365?v=4",
756      "gravatar_id": "",
757      "url": "https://api.github.com/users/asheshambasta",
758      "html_url": "https://github.com/asheshambasta",
759      "followers_url": "https://api.github.com/users/asheshambasta/followers",
760      "following_url": "https://api.github.com/users/asheshambasta/following{/other_user}",
761      "gists_url": "https://api.github.com/users/asheshambasta/gists{/gist_id}",
762      "starred_url": "https://api.github.com/users/asheshambasta/starred{/owner}{/repo}",
763      "subscriptions_url": "https://api.github.com/users/asheshambasta/subscriptions",
764      "organizations_url": "https://api.github.com/users/asheshambasta/orgs",
765      "repos_url": "https://api.github.com/users/asheshambasta/repos",
766      "events_url": "https://api.github.com/users/asheshambasta/events{/privacy}",
767      "received_events_url": "https://api.github.com/users/asheshambasta/received_events",
768      "type": "User",
769      "site_admin": false
770    },
771    "labels": [
772
773    ],
774    "state": "open",
775    "locked": false,
776    "assignee": null,
777    "assignees": [
778
779    ],
780    "milestone": null,
781    "comments": 6,
782    "created_at": "2018-12-21T10:38:51Z",
783    "updated_at": "2019-01-04T13:09:22Z",
784    "closed_at": null,
785    "author_association": "NONE",
786    "body": "We're using Haskell to write one of our services, and we're using Aeson for input-json parsing. \r\n\r\nHowever, the API of the platform as a whole _must_ expose standardised validation errors like my example:\r\n\r\n```javascript\r\n{\r\n  \"errors\": [\r\n    {\r\n      \"code\": \"ERR.SOMEFIELD.INVALID\",\r\n      \"field\": \"foo\",\r\n      \"type\": \"field\",\r\n      \"message\": \"Expecting an 'int' but got 'string'\"\r\n    },\r\n    {\r\n      \"code\": \"ERR.PLAN.INVALID_NAME\",\r\n      \"type\": \"field\",\r\n      \"field\" : \"user.plan\", \r\n      \"message\": \"All plan names must start with a 'urn:plan'\" // nullable \r\n    }\r\n  ],\r\n  \"service\": \"SomeServiceIdentifier/version\"\r\n}\r\n```\r\nI see that in Aeson this is not possible, since the `Error` data constructor only uses `String` for its output errors. Also, my understanding is that accumulating JSON errors is achieved using `(<*>+)` which is quite cool. \r\n\r\nWhat I'd like to understand is how we achieve some sort of a custom error type that can be represented like the example above, if possible at all. The naive approach would be to use `fail` with some sort of standardized string and then parse the custom error fields out of it, but that is rather unsatisfactory. \r\n\r\nIs there a way to achieve this? \r\n\r\n#\r\n\r\nEdit: I'd like to contribute to this, but I'm quite new to Haskell. "
787  },
788  {
789    "url": "https://api.github.com/repos/bos/aeson/issues/679",
790    "repository_url": "https://api.github.com/repos/bos/aeson",
791    "labels_url": "https://api.github.com/repos/bos/aeson/issues/679/labels{/name}",
792    "comments_url": "https://api.github.com/repos/bos/aeson/issues/679/comments",
793    "events_url": "https://api.github.com/repos/bos/aeson/issues/679/events",
794    "html_url": "https://github.com/bos/aeson/issues/679",
795    "id": 377974398,
796    "node_id": "MDU6SXNzdWUzNzc5NzQzOTg=",
797    "number": 679,
798    "title": "`FromJSON` and `ToJSON` don't roundtrip for `Double`",
799    "user": {
800      "login": "NorfairKing",
801      "id": 3521180,
802      "node_id": "MDQ6VXNlcjM1MjExODA=",
803      "avatar_url": "https://avatars3.githubusercontent.com/u/3521180?v=4",
804      "gravatar_id": "",
805      "url": "https://api.github.com/users/NorfairKing",
806      "html_url": "https://github.com/NorfairKing",
807      "followers_url": "https://api.github.com/users/NorfairKing/followers",
808      "following_url": "https://api.github.com/users/NorfairKing/following{/other_user}",
809      "gists_url": "https://api.github.com/users/NorfairKing/gists{/gist_id}",
810      "starred_url": "https://api.github.com/users/NorfairKing/starred{/owner}{/repo}",
811      "subscriptions_url": "https://api.github.com/users/NorfairKing/subscriptions",
812      "organizations_url": "https://api.github.com/users/NorfairKing/orgs",
813      "repos_url": "https://api.github.com/users/NorfairKing/repos",
814      "events_url": "https://api.github.com/users/NorfairKing/events{/privacy}",
815      "received_events_url": "https://api.github.com/users/NorfairKing/received_events",
816      "type": "User",
817      "site_admin": false
818    },
819    "labels": [
820
821    ],
822    "state": "open",
823    "locked": false,
824    "assignee": null,
825    "assignees": [
826
827    ],
828    "milestone": null,
829    "comments": 7,
830    "created_at": "2018-11-06T18:20:53Z",
831    "updated_at": "2018-11-06T21:51:29Z",
832    "closed_at": null,
833    "author_association": "NONE",
834    "body": "  ```\r\n1) Test.Validity.Aeson, JSON Double (unchecked), decode :: Data.ByteString.Lazy.ByteString -> Either String Double, ensures that encode and decode are inverses for \"unchecked Double\"'s\r\n       Falsifiable (after 12 tests):\r\n         Infinity\r\n       Decoding succeeded, but the decoded value\r\n       NaN\r\n       differs from expected decoded value\r\n       Infinity\r\n       'encode' encoded it to the json\r\n       \"null\"\r\n```"
835  },
836  {
837    "url": "https://api.github.com/repos/bos/aeson/issues/666",
838    "repository_url": "https://api.github.com/repos/bos/aeson",
839    "labels_url": "https://api.github.com/repos/bos/aeson/issues/666/labels{/name}",
840    "comments_url": "https://api.github.com/repos/bos/aeson/issues/666/comments",
841    "events_url": "https://api.github.com/repos/bos/aeson/issues/666/events",
842    "html_url": "https://github.com/bos/aeson/issues/666",
843    "id": 357916991,
844    "node_id": "MDU6SXNzdWUzNTc5MTY5OTE=",
845    "number": 666,
846    "title": "Add `withTypeableObject` that extracts name of the object from the type",
847    "user": {
848      "login": "chshersh",
849      "id": 4276606,
850      "node_id": "MDQ6VXNlcjQyNzY2MDY=",
851      "avatar_url": "https://avatars0.githubusercontent.com/u/4276606?v=4",
852      "gravatar_id": "",
853      "url": "https://api.github.com/users/chshersh",
854      "html_url": "https://github.com/chshersh",
855      "followers_url": "https://api.github.com/users/chshersh/followers",
856      "following_url": "https://api.github.com/users/chshersh/following{/other_user}",
857      "gists_url": "https://api.github.com/users/chshersh/gists{/gist_id}",
858      "starred_url": "https://api.github.com/users/chshersh/starred{/owner}{/repo}",
859      "subscriptions_url": "https://api.github.com/users/chshersh/subscriptions",
860      "organizations_url": "https://api.github.com/users/chshersh/orgs",
861      "repos_url": "https://api.github.com/users/chshersh/repos",
862      "events_url": "https://api.github.com/users/chshersh/events{/privacy}",
863      "received_events_url": "https://api.github.com/users/chshersh/received_events",
864      "type": "User",
865      "site_admin": false
866    },
867    "labels": [
868
869    ],
870    "state": "open",
871    "locked": false,
872    "assignee": null,
873    "assignees": [
874
875    ],
876    "milestone": null,
877    "comments": 0,
878    "created_at": "2018-09-07T04:38:20Z",
879    "updated_at": "2018-09-07T04:38:20Z",
880    "closed_at": null,
881    "author_association": "NONE",
882    "body": "Usually when I have custom data type like this one:\r\n\r\n```haskell\r\ndata Foo = Foo\r\n    { fooBar :: Int\r\n    , fooBaz :: Double\r\n    }\r\n```\r\n\r\nI write `FromJSON` instance like this:\r\n\r\n```haskell\r\ninstance FromJSON Foo where\r\n    parseJSON = withObject \"Foo\" $ \\o -> ...\r\n```\r\n\r\nI need to specify name of the type to get good error messages. But if type name changes, I need to not forget to update this function. Also, it's not really convenient to write name of type each type. I propose to add the following function to the `aeson` library:\r\n\r\n```haskell\r\ntypeName :: forall a . Typeable a => Text\r\ntypeName = show $ typeRep $ Proxy @a\r\n\r\nwithTypeableObject :: forall a . Typeable a => (Object -> Parser a) -> Value -> Parser a\r\nwithTypeableObject = withObject (typeName @a)\r\n```"
883  },
884  {
885    "url": "https://api.github.com/repos/bos/aeson/issues/660",
886    "repository_url": "https://api.github.com/repos/bos/aeson",
887    "labels_url": "https://api.github.com/repos/bos/aeson/issues/660/labels{/name}",
888    "comments_url": "https://api.github.com/repos/bos/aeson/issues/660/comments",
889    "events_url": "https://api.github.com/repos/bos/aeson/issues/660/events",
890    "html_url": "https://github.com/bos/aeson/issues/660",
891    "id": 348521320,
892    "node_id": "MDU6SXNzdWUzNDg1MjEzMjA=",
893    "number": 660,
894    "title": "Inconsistent encoding of Double depending on container structure",
895    "user": {
896      "login": "akhra",
897      "id": 3770453,
898      "node_id": "MDQ6VXNlcjM3NzA0NTM=",
899      "avatar_url": "https://avatars2.githubusercontent.com/u/3770453?v=4",
900      "gravatar_id": "",
901      "url": "https://api.github.com/users/akhra",
902      "html_url": "https://github.com/akhra",
903      "followers_url": "https://api.github.com/users/akhra/followers",
904      "following_url": "https://api.github.com/users/akhra/following{/other_user}",
905      "gists_url": "https://api.github.com/users/akhra/gists{/gist_id}",
906      "starred_url": "https://api.github.com/users/akhra/starred{/owner}{/repo}",
907      "subscriptions_url": "https://api.github.com/users/akhra/subscriptions",
908      "organizations_url": "https://api.github.com/users/akhra/orgs",
909      "repos_url": "https://api.github.com/users/akhra/repos",
910      "events_url": "https://api.github.com/users/akhra/events{/privacy}",
911      "received_events_url": "https://api.github.com/users/akhra/received_events",
912      "type": "User",
913      "site_admin": false
914    },
915    "labels": [
916
917    ],
918    "state": "open",
919    "locked": false,
920    "assignee": null,
921    "assignees": [
922
923    ],
924    "milestone": null,
925    "comments": 3,
926    "created_at": "2018-08-07T23:24:53Z",
927    "updated_at": "2018-08-08T12:33:03Z",
928    "closed_at": null,
929    "author_association": "NONE",
930    "body": "This is closely related to #546. Initially I thought there was some oddness specific to derived instances, but [this comment](https://github.com/bos/aeson/issues/546#issuecomment-299991780) pointed me toward a nice trivial example of the underlying cause:\r\n```haskell\r\nλ. import Data.Aeson\r\nλ. encode 0.0\r\n\"0.0\"\r\nλ. encode $ toJSON 0.0\r\n\"0\"\r\n```\r\nAnd its consequence:\r\n```haskell\r\nλ. :set -XDeriveGeneric -XDeriveAnyClass -XDerivingStrategies -XGeneralizedNewtypeDeriving\r\nλ. newtype Foo = Foo Double deriving Generic\r\nλ. deriving newtype instance ToJSON Foo\r\nλ. encode $ Foo 0.0\r\n\"0.0\"\r\nλ. newtype Bar = Bar Double deriving Generic\r\nλ. deriving anyclass instance ToJSON Bar\r\nλ. encode $ Bar 0.0\r\n\"0\"\r\nλ. data Baz = Baz Double deriving (Generic, ToJSON)\r\nλ. encode $ Baz 0.0\r\n\"0\"\r\nλ. data Qux = Qux Foo deriving (Generic, ToJSON)\r\nλ. encode $ Qux (Foo 0.0)\r\n\"0\"\r\n```\r\nThat last one is especially irksome: checking the newtype encoding doesn't reflect what the full structure will look like. (And of course, that's exactly the context where I ran into this.)\r\n\r\nThis issue is specifically about the _inconsistency_. It is surprising and undesirable that `Double`s render differently depending on context. Which way they _should_ be rendered probably belongs to #546. However, I should add that at present it's not a clear-cut matter of `deriving newtype` being the odd one out:\r\n```haskell\r\nλ. encode (0.0, \"whoops\")\r\n\"[0.0,\\\"whoops\\\"]\"\r\n```"
931  },
932  {
933    "url": "https://api.github.com/repos/bos/aeson/issues/659",
934    "repository_url": "https://api.github.com/repos/bos/aeson",
935    "labels_url": "https://api.github.com/repos/bos/aeson/issues/659/labels{/name}",
936    "comments_url": "https://api.github.com/repos/bos/aeson/issues/659/comments",
937    "events_url": "https://api.github.com/repos/bos/aeson/issues/659/events",
938    "html_url": "https://github.com/bos/aeson/issues/659",
939    "id": 348025769,
940    "node_id": "MDU6SXNzdWUzNDgwMjU3Njk=",
941    "number": 659,
942    "title": "FromJSONKeyCoerce warning",
943    "user": {
944      "login": "MaxGabriel",
945      "id": 1274145,
946      "node_id": "MDQ6VXNlcjEyNzQxNDU=",
947      "avatar_url": "https://avatars3.githubusercontent.com/u/1274145?v=4",
948      "gravatar_id": "",
949      "url": "https://api.github.com/users/MaxGabriel",
950      "html_url": "https://github.com/MaxGabriel",
951      "followers_url": "https://api.github.com/users/MaxGabriel/followers",
952      "following_url": "https://api.github.com/users/MaxGabriel/following{/other_user}",
953      "gists_url": "https://api.github.com/users/MaxGabriel/gists{/gist_id}",
954      "starred_url": "https://api.github.com/users/MaxGabriel/starred{/owner}{/repo}",
955      "subscriptions_url": "https://api.github.com/users/MaxGabriel/subscriptions",
956      "organizations_url": "https://api.github.com/users/MaxGabriel/orgs",
957      "repos_url": "https://api.github.com/users/MaxGabriel/repos",
958      "events_url": "https://api.github.com/users/MaxGabriel/events{/privacy}",
959      "received_events_url": "https://api.github.com/users/MaxGabriel/received_events",
960      "type": "User",
961      "site_admin": false
962    },
963    "labels": [
964
965    ],
966    "state": "open",
967    "locked": false,
968    "assignee": null,
969    "assignees": [
970
971    ],
972    "milestone": {
973      "url": "https://api.github.com/repos/bos/aeson/milestones/21",
974      "html_url": "https://github.com/bos/aeson/milestone/21",
975      "labels_url": "https://api.github.com/repos/bos/aeson/milestones/21/labels",
976      "id": 5240808,
977      "node_id": "MDk6TWlsZXN0b25lNTI0MDgwOA==",
978      "number": 21,
979      "title": "v1.5.0.0",
980      "description": "",
981      "creator": {
982        "login": "bergmark",
983        "id": 100681,
984        "node_id": "MDQ6VXNlcjEwMDY4MQ==",
985        "avatar_url": "https://avatars2.githubusercontent.com/u/100681?v=4",
986        "gravatar_id": "",
987        "url": "https://api.github.com/users/bergmark",
988        "html_url": "https://github.com/bergmark",
989        "followers_url": "https://api.github.com/users/bergmark/followers",
990        "following_url": "https://api.github.com/users/bergmark/following{/other_user}",
991        "gists_url": "https://api.github.com/users/bergmark/gists{/gist_id}",
992        "starred_url": "https://api.github.com/users/bergmark/starred{/owner}{/repo}",
993        "subscriptions_url": "https://api.github.com/users/bergmark/subscriptions",
994        "organizations_url": "https://api.github.com/users/bergmark/orgs",
995        "repos_url": "https://api.github.com/users/bergmark/repos",
996        "events_url": "https://api.github.com/users/bergmark/events{/privacy}",
997        "received_events_url": "https://api.github.com/users/bergmark/received_events",
998        "type": "User",
999        "site_admin": false
1000      },
1001      "open_issues": 1,
1002      "closed_issues": 6,
1003      "state": "open",
1004      "created_at": "2020-03-26T15:59:09Z",
1005      "updated_at": "2020-04-05T09:44:01Z",
1006      "due_on": null,
1007      "closed_at": null
1008    },
1009    "comments": 1,
1010    "created_at": "2018-08-06T18:02:56Z",
1011    "updated_at": "2020-04-04T14:40:37Z",
1012    "closed_at": null,
1013    "author_association": "NONE",
1014    "body": "Hi, I just installed aeson-1.4.0.0 and got this warning:\r\n\r\n```\r\nData/Aeson/Types/FromJSON.hs:468:3: warning: [-Winline-rule-shadowing]\r\n    Rule \"FromJSONKeyCoerce: fmap id\" may never fire\r\n      because ‘id’ might inline first\r\n    Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ‘id’\r\n    |\r\n468 |   \"FromJSONKeyCoerce: fmap id\"     forall (x :: FromJSONKeyFunction a).\r\n    |\r\n```\r\n\r\nIt's not causing me any problems, just wanted to let you know.\r\n\r\nLooks like the warning may have been around awhile since it appears here as well: https://github.com/bos/aeson/issues/543"
1015  },
1016  {
1017    "url": "https://api.github.com/repos/bos/aeson/issues/658",
1018    "repository_url": "https://api.github.com/repos/bos/aeson",
1019    "labels_url": "https://api.github.com/repos/bos/aeson/issues/658/labels{/name}",
1020    "comments_url": "https://api.github.com/repos/bos/aeson/issues/658/comments",
1021    "events_url": "https://api.github.com/repos/bos/aeson/issues/658/events",
1022    "html_url": "https://github.com/bos/aeson/issues/658",
1023    "id": 346293459,
1024    "node_id": "MDU6SXNzdWUzNDYyOTM0NTk=",
1025    "number": 658,
1026    "title": "Make functions inlinable",
1027    "user": {
1028      "login": "flip111",
1029      "id": 2244480,
1030      "node_id": "MDQ6VXNlcjIyNDQ0ODA=",
1031      "avatar_url": "https://avatars3.githubusercontent.com/u/2244480?v=4",
1032      "gravatar_id": "",
1033      "url": "https://api.github.com/users/flip111",
1034      "html_url": "https://github.com/flip111",
1035      "followers_url": "https://api.github.com/users/flip111/followers",
1036      "following_url": "https://api.github.com/users/flip111/following{/other_user}",
1037      "gists_url": "https://api.github.com/users/flip111/gists{/gist_id}",
1038      "starred_url": "https://api.github.com/users/flip111/starred{/owner}{/repo}",
1039      "subscriptions_url": "https://api.github.com/users/flip111/subscriptions",
1040      "organizations_url": "https://api.github.com/users/flip111/orgs",
1041      "repos_url": "https://api.github.com/users/flip111/repos",
1042      "events_url": "https://api.github.com/users/flip111/events{/privacy}",
1043      "received_events_url": "https://api.github.com/users/flip111/received_events",
1044      "type": "User",
1045      "site_admin": false
1046    },
1047    "labels": [
1048
1049    ],
1050    "state": "open",
1051    "locked": false,
1052    "assignee": null,
1053    "assignees": [
1054
1055    ],
1056    "milestone": null,
1057    "comments": 2,
1058    "created_at": "2018-07-31T17:49:10Z",
1059    "updated_at": "2020-04-04T12:57:44Z",
1060    "closed_at": null,
1061    "author_association": "NONE",
1062    "body": "When i compile with `-Wmissed-specialisations` actually indirectly by compiling with `-Weverything` i get the following warnings:\r\n\r\n```\r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$ctoJSONKey’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fToJSONKey(,)_$ctoJSONKey’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$ctoJSONKey’\r\n\r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$cgToJSON’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fGToJSONencarityM11_$cgToJSON’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$cgToJSON’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$csumToJSON'2’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fSumToJSON'TYPETwoElemArrayValuearityM2’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$csumToJSON'2’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$csumToJSON'’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fSumToJSON'TYPEObjectWithSingleFieldencarityM1_$csumToJSON'’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$csumToJSON'’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$ctaggedObject’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fTaggedObjectencarityM1_$ctaggedObject’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$ctaggedObject’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fGToJSONValuearity:*:_$cgToJSON’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fGToJSONValuearity:*:_$cgToJSON’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fKeyValuePairvDList_$cpair’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fKeyValuePairvDList’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fKeyValuePairvDList_$cpair’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$cwriteProduct’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fWriteProductarity:*:_$cwriteProduct’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$cwriteProduct’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$cwriteProduct1’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fWriteProductaritya_$cwriteProduct’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$cwriteProduct1’\r\n              \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$csumToJSON'1’\r\n      when specialising ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fSumToJSON'TYPETwoElemArrayEncoding'arityM2’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$w$csumToJSON'1’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fGToJSONEncoding'arity:*:1’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fGToJSONEncoding'arity:*:1’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fEncodeProductarity:*:_$cencodeProduct’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fEncodeProductarity:*:_$cencodeProduct’\r\n                             \r\nsrc/Main.hs: warning:        \r\n    Could not specialise imported function ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fKeyValuePairvDList_$cpair’\r\n    Probable fix: add INLINABLE pragma on ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON.$fKeyValuePairvDList_$cpair’\r\n```\r\n\r\nI think there is a missed optimization here. The inlinable pragma should be added in the module which export these functions."
1063  },
1064  {
1065    "url": "https://api.github.com/repos/bos/aeson/issues/653",
1066    "repository_url": "https://api.github.com/repos/bos/aeson",
1067    "labels_url": "https://api.github.com/repos/bos/aeson/issues/653/labels{/name}",
1068    "comments_url": "https://api.github.com/repos/bos/aeson/issues/653/comments",
1069    "events_url": "https://api.github.com/repos/bos/aeson/issues/653/events",
1070    "html_url": "https://github.com/bos/aeson/pull/653",
1071    "id": 343386192,
1072    "node_id": "MDExOlB1bGxSZXF1ZXN0MjAzMDQ1MDcx",
1073    "number": 653,
1074    "title": "Rework GFromJSON instances to enable elimination of Generics",
1075    "user": {
1076      "login": "remyoudompheng",
1077      "id": 175246,
1078      "node_id": "MDQ6VXNlcjE3NTI0Ng==",
1079      "avatar_url": "https://avatars3.githubusercontent.com/u/175246?v=4",
1080      "gravatar_id": "",
1081      "url": "https://api.github.com/users/remyoudompheng",
1082      "html_url": "https://github.com/remyoudompheng",
1083      "followers_url": "https://api.github.com/users/remyoudompheng/followers",
1084      "following_url": "https://api.github.com/users/remyoudompheng/following{/other_user}",
1085      "gists_url": "https://api.github.com/users/remyoudompheng/gists{/gist_id}",
1086      "starred_url": "https://api.github.com/users/remyoudompheng/starred{/owner}{/repo}",
1087      "subscriptions_url": "https://api.github.com/users/remyoudompheng/subscriptions",
1088      "organizations_url": "https://api.github.com/users/remyoudompheng/orgs",
1089      "repos_url": "https://api.github.com/users/remyoudompheng/repos",
1090      "events_url": "https://api.github.com/users/remyoudompheng/events{/privacy}",
1091      "received_events_url": "https://api.github.com/users/remyoudompheng/received_events",
1092      "type": "User",
1093      "site_admin": false
1094    },
1095    "labels": [
1096      {
1097        "id": 713822109,
1098        "node_id": "MDU6TGFiZWw3MTM4MjIxMDk=",
1099        "url": "https://api.github.com/repos/bos/aeson/labels/versioning%20level:%20minor/non-breaking%20addition",
1100        "name": "versioning level: minor/non-breaking addition",
1101        "color": "fbca04",
1102        "default": false,
1103        "description": null
1104      }
1105    ],
1106    "state": "open",
1107    "locked": false,
1108    "assignee": null,
1109    "assignees": [
1110
1111    ],
1112    "milestone": null,
1113    "comments": 9,
1114    "created_at": "2018-07-22T07:55:44Z",
1115    "updated_at": "2019-09-07T14:56:10Z",
1116    "closed_at": null,
1117    "author_association": "NONE",
1118    "pull_request": {
1119      "url": "https://api.github.com/repos/bos/aeson/pulls/653",
1120      "html_url": "https://github.com/bos/aeson/pull/653",
1121      "diff_url": "https://github.com/bos/aeson/pull/653.diff",
1122      "patch_url": "https://github.com/bos/aeson/pull/653.patch"
1123    },
1124    "body": "The Parser monad signature makes inlining very difficult\r\nbecause GHC only inlines saturated applications, which is\r\nhard to achieve with Parser.\r\n\r\nWe work around this by defining an alternate method in GFromJSON\r\nwhich manipulates the semantically equivalent IResult monad\r\n(Parser is technically more expressive but not for the terms appearing\r\nin GFromJSON). The existing method is left for API compatibility.\r\n\r\nThe resulting code achieves rougly the same compilation speed but\r\nreaches large performance improvements, for a generated code size\r\nnot far from the manually written instances in benchmarks.\r\n\r\nThe object file for Twitter.Generic grows to 332kB (from 285kB),\r\nbut the Twitter.Manual module is 300kB large. The inlining level of\r\ntypeMismatch has been reduced to curb code blow-up.\r\n\r\nDue to inlining levels differences, the Generic fromJSON is now\r\noften quicker than its TH or Manual counterpart in benchmarks.\r\n\r\nBenchmark results (Core i5 Haswell)\r\n\r\n| | TH | Generic (before) | Generic (after) | Manual |\r\n| --- | --- | --- | --- | --- |\r\n| D/fromJSON | 1.720 µs | 5.076 µs | 1.505 µs | - |\r\n| BigRecord/fromJSON | 3.720 µs | 8.450 µs | 2.964 µs | - |\r\n| BigProduct/fromJSON | 2.412 µs | 3.427 µs | 1.812 µs | - |\r\n| BigSum/fromJSON | 173 ns | 1230 ns | 171 ns | - |\r\n| twitter100 | 1.611 ms | 2.063 ms | 1.334 ms | 1.516 ms |\r\n| jp100 | 1.844 ms | 2.18 ms | 1.481 ms | 1.677 ms |\r\n"
1125  },
1126  {
1127    "url": "https://api.github.com/repos/bos/aeson/issues/651",
1128    "repository_url": "https://api.github.com/repos/bos/aeson",
1129    "labels_url": "https://api.github.com/repos/bos/aeson/issues/651/labels{/name}",
1130    "comments_url": "https://api.github.com/repos/bos/aeson/issues/651/comments",
1131    "events_url": "https://api.github.com/repos/bos/aeson/issues/651/events",
1132    "html_url": "https://github.com/bos/aeson/issues/651",
1133    "id": 340747607,
1134    "node_id": "MDU6SXNzdWUzNDA3NDc2MDc=",
1135    "number": 651,
1136    "title": "Can't use .= operator to build JSON because of ambiguous instances.",
1137    "user": {
1138      "login": "LeifW",
1139      "id": 28711,
1140      "node_id": "MDQ6VXNlcjI4NzEx",
1141      "avatar_url": "https://avatars2.githubusercontent.com/u/28711?v=4",
1142      "gravatar_id": "",
1143      "url": "https://api.github.com/users/LeifW",
1144      "html_url": "https://github.com/LeifW",
1145      "followers_url": "https://api.github.com/users/LeifW/followers",
1146      "following_url": "https://api.github.com/users/LeifW/following{/other_user}",
1147      "gists_url": "https://api.github.com/users/LeifW/gists{/gist_id}",
1148      "starred_url": "https://api.github.com/users/LeifW/starred{/owner}{/repo}",
1149      "subscriptions_url": "https://api.github.com/users/LeifW/subscriptions",
1150      "organizations_url": "https://api.github.com/users/LeifW/orgs",
1151      "repos_url": "https://api.github.com/users/LeifW/repos",
1152      "events_url": "https://api.github.com/users/LeifW/events{/privacy}",
1153      "received_events_url": "https://api.github.com/users/LeifW/received_events",
1154      "type": "User",
1155      "site_admin": false
1156    },
1157    "labels": [
1158
1159    ],
1160    "state": "open",
1161    "locked": false,
1162    "assignee": null,
1163    "assignees": [
1164
1165    ],
1166    "milestone": null,
1167    "comments": 4,
1168    "created_at": "2018-07-12T18:24:11Z",
1169    "updated_at": "2018-07-15T17:11:21Z",
1170    "closed_at": null,
1171    "author_association": "NONE",
1172    "body": "I put up a gist: https://gist.github.com/LeifW/f3e51437f4494eff9d7c23355f268ef7\r\n\r\nEssentially, this file\r\n```haskell\r\n{-# LANGUAGE OverloadedStrings  #-}\r\n\r\nimport Data.Aeson \r\n\r\nthing = object [ \"foo\" .= \"bar\" ]\r\n```\r\ngives this error message when you try to compile it:\r\n```\r\ntest.hs:5:18: error:\r\n    • Ambiguous type variable ‘v0’ arising from a use of ‘.=’\r\n      prevents the constraint ‘(ToJSON v0)’ from being solved.\r\n      Probable fix: use a type annotation to specify what ‘v0’ should be.\r\n      These potential instances exist:\r\n        instance ToJSON DotNetTime\r\n          -- Defined in ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON’\r\n        instance ToJSON Value\r\n          -- Defined in ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON’\r\n        instance (ToJSON a, ToJSON b) => ToJSON (Either a b)\r\n          -- Defined in ‘aeson-1.3.1.1:Data.Aeson.Types.ToJSON’\r\n        ...plus 25 others\r\n        ...plus 55 instances involving out-of-scope types\r\n        (use -fprint-potential-instances to see them all)\r\n    • In the expression: \"foo\" .= \"bar\"\r\n      In the first argument of ‘object’, namely ‘[\"foo\" .= \"bar\"]’\r\n      In the expression: object [\"foo\" .= \"bar\"]\r\n  |\r\n5 | thing = object [ \"foo\" .= \"bar\" ]\r\n  |                  ^^^^^^^^^^^^^^\r\n\r\ntest.hs:5:27: error:\r\n    • Ambiguous type variable ‘v0’ arising from the literal ‘\"bar\"’\r\n      prevents the constraint ‘(Data.String.IsString\r\n                                  v0)’ from being solved.\r\n      Probable fix: use a type annotation to specify what ‘v0’ should be.\r\n      These potential instances exist:\r\n        instance Data.String.IsString Value\r\n          -- Defined in ‘aeson-1.3.1.1:Data.Aeson.Types.Internal’\r\n        instance (a ~ Char) => Data.String.IsString [a]\r\n          -- Defined in ‘Data.String’\r\n        ...plus 11 instances involving out-of-scope types\r\n        (use -fprint-potential-instances to see them all)\r\n    • In the second argument of ‘(.=)’, namely ‘\"bar\"’\r\n      In the expression: \"foo\" .= \"bar\"\r\n      In the first argument of ‘object’, namely ‘[\"foo\" .= \"bar\"]’\r\n  |\r\n5 | thing = object [ \"foo\" .= \"bar\" ]\r\n```\r\nIt works in the repl and/or if you add `ExtendedDefaultRules`, though."
1173  },
1174  {
1175    "url": "https://api.github.com/repos/bos/aeson/issues/647",
1176    "repository_url": "https://api.github.com/repos/bos/aeson",
1177    "labels_url": "https://api.github.com/repos/bos/aeson/issues/647/labels{/name}",
1178    "comments_url": "https://api.github.com/repos/bos/aeson/issues/647/comments",
1179    "events_url": "https://api.github.com/repos/bos/aeson/issues/647/events",
1180    "html_url": "https://github.com/bos/aeson/pull/647",
1181    "id": 331981135,
1182    "node_id": "MDExOlB1bGxSZXF1ZXN0MTk0NTc1ODg2",
1183    "number": 647,
1184    "title": "Export `withBoundedScientific`",
1185    "user": {
1186      "login": "qrilka",
1187      "id": 70110,
1188      "node_id": "MDQ6VXNlcjcwMTEw",
1189      "avatar_url": "https://avatars2.githubusercontent.com/u/70110?v=4",
1190      "gravatar_id": "",
1191      "url": "https://api.github.com/users/qrilka",
1192      "html_url": "https://github.com/qrilka",
1193      "followers_url": "https://api.github.com/users/qrilka/followers",
1194      "following_url": "https://api.github.com/users/qrilka/following{/other_user}",
1195      "gists_url": "https://api.github.com/users/qrilka/gists{/gist_id}",
1196      "starred_url": "https://api.github.com/users/qrilka/starred{/owner}{/repo}",
1197      "subscriptions_url": "https://api.github.com/users/qrilka/subscriptions",
1198      "organizations_url": "https://api.github.com/users/qrilka/orgs",
1199      "repos_url": "https://api.github.com/users/qrilka/repos",
1200      "events_url": "https://api.github.com/users/qrilka/events{/privacy}",
1201      "received_events_url": "https://api.github.com/users/qrilka/received_events",
1202      "type": "User",
1203      "site_admin": false
1204    },
1205    "labels": [
1206      {
1207        "id": 713822109,
1208        "node_id": "MDU6TGFiZWw3MTM4MjIxMDk=",
1209        "url": "https://api.github.com/repos/bos/aeson/labels/versioning%20level:%20minor/non-breaking%20addition",
1210        "name": "versioning level: minor/non-breaking addition",
1211        "color": "fbca04",
1212        "default": false,
1213        "description": null
1214      }
1215    ],
1216    "state": "open",
1217    "locked": false,
1218    "assignee": null,
1219    "assignees": [
1220
1221    ],
1222    "milestone": null,
1223    "comments": 1,
1224    "created_at": "2018-06-13T12:52:28Z",
1225    "updated_at": "2018-06-14T19:59:58Z",
1226    "closed_at": null,
1227    "author_association": "NONE",
1228    "pull_request": {
1229      "url": "https://api.github.com/repos/bos/aeson/pulls/647",
1230      "html_url": "https://github.com/bos/aeson/pull/647",
1231      "diff_url": "https://github.com/bos/aeson/pull/647.diff",
1232      "patch_url": "https://github.com/bos/aeson/pull/647.patch"
1233    },
1234    "body": "http://hackage.haskell.org/package/aeson-1.4.0.0/docs/Data-Aeson.html#v:withScientific advises to use `withBoundedScientific` for unbounded types but the function wasn't exported"
1235  },
1236  {
1237    "url": "https://api.github.com/repos/bos/aeson/issues/646",
1238    "repository_url": "https://api.github.com/repos/bos/aeson",
1239    "labels_url": "https://api.github.com/repos/bos/aeson/issues/646/labels{/name}",
1240    "comments_url": "https://api.github.com/repos/bos/aeson/issues/646/comments",
1241    "events_url": "https://api.github.com/repos/bos/aeson/issues/646/events",
1242    "html_url": "https://github.com/bos/aeson/issues/646",
1243    "id": 331495282,
1244    "node_id": "MDU6SXNzdWUzMzE0OTUyODI=",
1245    "number": 646,
1246    "title": "Allow accepting missing fields of other types than Maybe",
1247    "user": {
1248      "login": "lortabac",
1249      "id": 1907333,
1250      "node_id": "MDQ6VXNlcjE5MDczMzM=",
1251      "avatar_url": "https://avatars3.githubusercontent.com/u/1907333?v=4",
1252      "gravatar_id": "",
1253      "url": "https://api.github.com/users/lortabac",
1254      "html_url": "https://github.com/lortabac",
1255      "followers_url": "https://api.github.com/users/lortabac/followers",
1256      "following_url": "https://api.github.com/users/lortabac/following{/other_user}",
1257      "gists_url": "https://api.github.com/users/lortabac/gists{/gist_id}",
1258      "starred_url": "https://api.github.com/users/lortabac/starred{/owner}{/repo}",
1259      "subscriptions_url": "https://api.github.com/users/lortabac/subscriptions",
1260      "organizations_url": "https://api.github.com/users/lortabac/orgs",
1261      "repos_url": "https://api.github.com/users/lortabac/repos",
1262      "events_url": "https://api.github.com/users/lortabac/events{/privacy}",
1263      "received_events_url": "https://api.github.com/users/lortabac/received_events",
1264      "type": "User",
1265      "site_admin": false
1266    },
1267    "labels": [
1268
1269    ],
1270    "state": "open",
1271    "locked": false,
1272    "assignee": null,
1273    "assignees": [
1274
1275    ],
1276    "milestone": null,
1277    "comments": 13,
1278    "created_at": "2018-06-12T08:51:26Z",
1279    "updated_at": "2019-12-29T19:42:07Z",
1280    "closed_at": null,
1281    "author_association": "NONE",
1282    "body": "When deriving `FromJSON` instances generically, there is no way to provide a default value to a missing field of a record if the field is not a `Maybe`.\r\n\r\nThis seems related to #614, in that the proposed solution may help fixing both issues."
1283  },
1284  {
1285    "url": "https://api.github.com/repos/bos/aeson/issues/644",
1286    "repository_url": "https://api.github.com/repos/bos/aeson",
1287    "labels_url": "https://api.github.com/repos/bos/aeson/issues/644/labels{/name}",
1288    "comments_url": "https://api.github.com/repos/bos/aeson/issues/644/comments",
1289    "events_url": "https://api.github.com/repos/bos/aeson/issues/644/events",
1290    "html_url": "https://github.com/bos/aeson/issues/644",
1291    "id": 326014300,
1292    "node_id": "MDU6SXNzdWUzMjYwMTQzMDA=",
1293    "number": 644,
1294    "title": "Expose Data.Aeson.Encoding.Builder",
1295    "user": {
1296      "login": "alexbiehl",
1297      "id": 1876617,
1298      "node_id": "MDQ6VXNlcjE4NzY2MTc=",
1299      "avatar_url": "https://avatars2.githubusercontent.com/u/1876617?v=4",
1300      "gravatar_id": "",
1301      "url": "https://api.github.com/users/alexbiehl",
1302      "html_url": "https://github.com/alexbiehl",
1303      "followers_url": "https://api.github.com/users/alexbiehl/followers",
1304      "following_url": "https://api.github.com/users/alexbiehl/following{/other_user}",
1305      "gists_url": "https://api.github.com/users/alexbiehl/gists{/gist_id}",
1306      "starred_url": "https://api.github.com/users/alexbiehl/starred{/owner}{/repo}",
1307      "subscriptions_url": "https://api.github.com/users/alexbiehl/subscriptions",
1308      "organizations_url": "https://api.github.com/users/alexbiehl/orgs",
1309      "repos_url": "https://api.github.com/users/alexbiehl/repos",
1310      "events_url": "https://api.github.com/users/alexbiehl/events{/privacy}",
1311      "received_events_url": "https://api.github.com/users/alexbiehl/received_events",
1312      "type": "User",
1313      "site_admin": false
1314    },
1315    "labels": [
1316      {
1317        "id": 563935541,
1318        "node_id": "MDU6TGFiZWw1NjM5MzU1NDE=",
1319        "url": "https://api.github.com/repos/bos/aeson/labels/needs%20decision",
1320        "name": "needs decision",
1321        "color": "c5def5",
1322        "default": false,
1323        "description": null
1324      }
1325    ],
1326    "state": "open",
1327    "locked": false,
1328    "assignee": null,
1329    "assignees": [
1330
1331    ],
1332    "milestone": null,
1333    "comments": 3,
1334    "created_at": "2018-05-24T08:24:58Z",
1335    "updated_at": "2018-08-05T20:38:09Z",
1336    "closed_at": null,
1337    "author_association": "NONE",
1338    "body": "At work we have a JSON schema which demands composite keys for objects of this form: \r\n\r\n```\r\n\"<some integer>_<day>\": ... \r\n```\r\n\r\nNow, we used the venerable `toKey (n, d) = Text.pack (show n ++ '_' ++ show d)` but this turned out out to show up in our profiling and really was taking 10% of our overall runtime! So we went for some cruel hack:  \r\n\r\n```haskell\r\n     toKey (n ,d) = Encoding.unsafeToEncoding $\r\n           Builder.char7 '\"' <> Builder.intDec r <> Builder.char7 '_'\r\n        <> Encoding.fromEncoding (Encoding.day d) <>  Builder.char7 '\"'\r\n```\r\n\r\nUnfortunately this results in invalid JSON as `Encoding.day` is wrapped into quotes! It would be really neat if we could access the unsafe stuff from Data.Aeson.Encoding.Builder to use the `Day` encoding without quotes.\r\n\r\n"
1339  },
1340  {
1341    "url": "https://api.github.com/repos/bos/aeson/issues/642",
1342    "repository_url": "https://api.github.com/repos/bos/aeson",
1343    "labels_url": "https://api.github.com/repos/bos/aeson/issues/642/labels{/name}",
1344    "comments_url": "https://api.github.com/repos/bos/aeson/issues/642/comments",
1345    "events_url": "https://api.github.com/repos/bos/aeson/issues/642/events",
1346    "html_url": "https://github.com/bos/aeson/issues/642",
1347    "id": 323568779,
1348    "node_id": "MDU6SXNzdWUzMjM1Njg3Nzk=",
1349    "number": 642,
1350    "title": "Dealing with empty object from API service",
1351    "user": {
1352      "login": "Rizary",
1353      "id": 7221768,
1354      "node_id": "MDQ6VXNlcjcyMjE3Njg=",
1355      "avatar_url": "https://avatars3.githubusercontent.com/u/7221768?v=4",
1356      "gravatar_id": "",
1357      "url": "https://api.github.com/users/Rizary",
1358      "html_url": "https://github.com/Rizary",
1359      "followers_url": "https://api.github.com/users/Rizary/followers",
1360      "following_url": "https://api.github.com/users/Rizary/following{/other_user}",
1361      "gists_url": "https://api.github.com/users/Rizary/gists{/gist_id}",
1362      "starred_url": "https://api.github.com/users/Rizary/starred{/owner}{/repo}",
1363      "subscriptions_url": "https://api.github.com/users/Rizary/subscriptions",
1364      "organizations_url": "https://api.github.com/users/Rizary/orgs",
1365      "repos_url": "https://api.github.com/users/Rizary/repos",
1366      "events_url": "https://api.github.com/users/Rizary/events{/privacy}",
1367      "received_events_url": "https://api.github.com/users/Rizary/received_events",
1368      "type": "User",
1369      "site_admin": false
1370    },
1371    "labels": [
1372      {
1373        "id": 315555511,
1374        "node_id": "MDU6TGFiZWwzMTU1NTU1MTE=",
1375        "url": "https://api.github.com/repos/bos/aeson/labels/question",
1376        "name": "question",
1377        "color": "5319e7",
1378        "default": true,
1379        "description": null
1380      }
1381    ],
1382    "state": "open",
1383    "locked": false,
1384    "assignee": null,
1385    "assignees": [
1386
1387    ],
1388    "milestone": null,
1389    "comments": 2,
1390    "created_at": "2018-05-16T10:52:05Z",
1391    "updated_at": "2018-06-23T15:08:38Z",
1392    "closed_at": null,
1393    "author_association": "NONE",
1394    "body": "Hi, what is the best to handle when we got `name: {}`  (this is from nodejs backend) response from api service, meanwhile what i want is to assume it is 'name: {first: \"\", last: \"\"}` so I can parse it to \r\n```Person {firstName :: Maybe Text, lastName :: Maybe Text}``` ?\r\n\r\nsupposed that I have the following types:\r\nhttps://gist.github.com/Rizary/3b3865a145853cf04df7fad4e348a5c3\r\n\r\nI finally use `optional` but actually that's not what I want, because I can't parsed the `name: {}` as `name: {first: \"\", last: \"\"}`"
1395  },
1396  {
1397    "url": "https://api.github.com/repos/bos/aeson/issues/641",
1398    "repository_url": "https://api.github.com/repos/bos/aeson",
1399    "labels_url": "https://api.github.com/repos/bos/aeson/issues/641/labels{/name}",
1400    "comments_url": "https://api.github.com/repos/bos/aeson/issues/641/comments",
1401    "events_url": "https://api.github.com/repos/bos/aeson/issues/641/events",
1402    "html_url": "https://github.com/bos/aeson/issues/641",
1403    "id": 322585124,
1404    "node_id": "MDU6SXNzdWUzMjI1ODUxMjQ=",
1405    "number": 641,
1406    "title": "Building failed on GHC 8.0.2",
1407    "user": {
1408      "login": "pe200012",
1409      "id": 13463539,
1410      "node_id": "MDQ6VXNlcjEzNDYzNTM5",
1411      "avatar_url": "https://avatars1.githubusercontent.com/u/13463539?v=4",
1412      "gravatar_id": "",
1413      "url": "https://api.github.com/users/pe200012",
1414      "html_url": "https://github.com/pe200012",
1415      "followers_url": "https://api.github.com/users/pe200012/followers",
1416      "following_url": "https://api.github.com/users/pe200012/following{/other_user}",
1417      "gists_url": "https://api.github.com/users/pe200012/gists{/gist_id}",
1418      "starred_url": "https://api.github.com/users/pe200012/starred{/owner}{/repo}",
1419      "subscriptions_url": "https://api.github.com/users/pe200012/subscriptions",
1420      "organizations_url": "https://api.github.com/users/pe200012/orgs",
1421      "repos_url": "https://api.github.com/users/pe200012/repos",
1422      "events_url": "https://api.github.com/users/pe200012/events{/privacy}",
1423      "received_events_url": "https://api.github.com/users/pe200012/received_events",
1424      "type": "User",
1425      "site_admin": false
1426    },
1427    "labels": [
1428
1429    ],
1430    "state": "open",
1431    "locked": false,
1432    "assignee": null,
1433    "assignees": [
1434
1435    ],
1436    "milestone": null,
1437    "comments": 5,
1438    "created_at": "2018-05-13T11:16:59Z",
1439    "updated_at": "2018-06-23T15:23:48Z",
1440    "closed_at": null,
1441    "author_association": "NONE",
1442    "body": "<pre>\r\n[ 1 of 24] Compiling Data.Attoparsec.Time.Internal ( attoparsec-iso8601/Data/Attoparsec/Time/Internal.hs, dist/build/Data/Attoparsec/Time/Internal.o )\r\n[ 2 of 24] Compiling Data.Attoparsec.Time ( attoparsec-iso8601/Data/Attoparsec/Time.hs, dist/build/Data/Attoparsec/Time.o )\r\n[ 3 of 24] Compiling Data.Aeson.Types.Internal ( Data/Aeson/Types/Internal.hs, dist/build/Data/Aeson/Types/Internal.o )\r\n\r\nData/Aeson/Types/Internal.hs:397:17: error:\r\n    • Can't find interface-file declaration for type constructor or class Language.Haskell.TH.Lib.ExpQ\r\n        Probable cause: bug in .hi-boot file, or inconsistent .hi file\r\n        Use -ddump-if-trace to get an idea of which file caused the error\r\n    • In the expression: [| Null |]\r\n      In an equation for ‘lift’: lift Null = [| Null |]\r\n      In the instance declaration for ‘TH.Lift Value’\r\ncabal: Leaving directory '/tmp/cabal-tmp-12259/aeson-1.2.4.0'\r\ncabal: Error: some packages failed to install:\r\naeson-1.2.4.0 failed during the building phase. The exception was:\r\nExitFailure 1\r\nhttp-conduit-2.3.1 depends on aeson-1.2.4.0 which failed to install.\r\nidringen-0.1.0.3 depends on aeson-1.2.4.0 which failed to install.\r\nidris-1.2.0 depends on aeson-1.2.4.0 which failed to install.\r\n\r\n</pre>\r\nbuild separately,\r\n<pre>\r\nPreprocessing library aeson-1.3.1.1...\r\n[ 1 of 24] Compiling Data.Attoparsec.Time.Internal ( attoparsec-iso8601/Data/Attoparsec/Time/Internal.hs, dist/build/Data/Attoparsec/Time/Internal.o )\r\n[ 2 of 24] Compiling Data.Attoparsec.Time ( attoparsec-iso8601/Data/Attoparsec/Time.hs, dist/build/Data/Attoparsec/Time.o )\r\n[ 3 of 24] Compiling Data.Aeson.Types.Internal ( Data/Aeson/Types/Internal.hs, dist/build/Data/Aeson/Types/Internal.o )\r\n\r\nData/Aeson/Types/Internal.hs:399:17: error:\r\n    • Can't find interface-file declaration for type constructor or class Language.Haskell.TH.Lib.ExpQ\r\n        Probable cause: bug in .hi-boot file, or inconsistent .hi file\r\n        Use -ddump-if-trace to get an idea of which file caused the error\r\n    • In the expression: [| Null |]\r\n      In an equation for ‘lift’: lift Null = [| Null |]\r\n      In the instance declaration for ‘TH.Lift Value’\r\ncabal: Leaving directory '/tmp/cabal-tmp-12422/aeson-1.3.1.1'\r\ncabal: Error: some packages failed to install:\r\naeson-1.3.1.1 failed during the building phase. The exception was:\r\nExitFailure 1\r\n</pre>"
1443  },
1444  {
1445    "url": "https://api.github.com/repos/bos/aeson/issues/624",
1446    "repository_url": "https://api.github.com/repos/bos/aeson",
1447    "labels_url": "https://api.github.com/repos/bos/aeson/issues/624/labels{/name}",
1448    "comments_url": "https://api.github.com/repos/bos/aeson/issues/624/comments",
1449    "events_url": "https://api.github.com/repos/bos/aeson/issues/624/events",
1450    "html_url": "https://github.com/bos/aeson/issues/624",
1451    "id": 299707462,
1452    "node_id": "MDU6SXNzdWUyOTk3MDc0NjI=",
1453    "number": 624,
1454    "title": "Add some way (or document if it already exists) to extract data type name in 'defaultOptions'",
1455    "user": {
1456      "login": "chshersh",
1457      "id": 4276606,
1458      "node_id": "MDQ6VXNlcjQyNzY2MDY=",
1459      "avatar_url": "https://avatars0.githubusercontent.com/u/4276606?v=4",
1460      "gravatar_id": "",
1461      "url": "https://api.github.com/users/chshersh",
1462      "html_url": "https://github.com/chshersh",
1463      "followers_url": "https://api.github.com/users/chshersh/followers",
1464      "following_url": "https://api.github.com/users/chshersh/following{/other_user}",
1465      "gists_url": "https://api.github.com/users/chshersh/gists{/gist_id}",
1466      "starred_url": "https://api.github.com/users/chshersh/starred{/owner}{/repo}",
1467      "subscriptions_url": "https://api.github.com/users/chshersh/subscriptions",
1468      "organizations_url": "https://api.github.com/users/chshersh/orgs",
1469      "repos_url": "https://api.github.com/users/chshersh/repos",
1470      "events_url": "https://api.github.com/users/chshersh/events{/privacy}",
1471      "received_events_url": "https://api.github.com/users/chshersh/received_events",
1472      "type": "User",
1473      "site_admin": false
1474    },
1475    "labels": [
1476
1477    ],
1478    "state": "open",
1479    "locked": false,
1480    "assignee": null,
1481    "assignees": [
1482
1483    ],
1484    "milestone": null,
1485    "comments": 6,
1486    "created_at": "2018-02-23T13:13:52Z",
1487    "updated_at": "2018-09-07T04:07:09Z",
1488    "closed_at": null,
1489    "author_association": "NONE",
1490    "body": "I want to add full data type name to every field of my data type. Like this:\r\n\r\n```haskell\r\ndata ProjectManager = ProjectManager\r\n    { projectManagerName   :: Text\r\n    , projectManagerSalary :: Natural\r\n    }\r\n```\r\n\r\nAnd I want to have JSON encoding like this: `{ name: \"Vasya Pupkin\", salary: 42 }`. I don't see any way to implement general `Options` data type which can automatically work for any type with [`fieldLabelModifier`](https://hackage.haskell.org/package/aeson-1.2.4.0/docs/Data-Aeson.html#v:fieldLabelModifier) because I don't know type name from context."
1491  },
1492  {
1493    "url": "https://api.github.com/repos/bos/aeson/issues/622",
1494    "repository_url": "https://api.github.com/repos/bos/aeson",
1495    "labels_url": "https://api.github.com/repos/bos/aeson/issues/622/labels{/name}",
1496    "comments_url": "https://api.github.com/repos/bos/aeson/issues/622/comments",
1497    "events_url": "https://api.github.com/repos/bos/aeson/issues/622/events",
1498    "html_url": "https://github.com/bos/aeson/issues/622",
1499    "id": 296505410,
1500    "node_id": "MDU6SXNzdWUyOTY1MDU0MTA=",
1501    "number": 622,
1502    "title": "ToJSON/FromJSON instances fail for UTCTime, DiffTime",
1503    "user": {
1504      "login": "brainwave0",
1505      "id": 3056980,
1506      "node_id": "MDQ6VXNlcjMwNTY5ODA=",
1507      "avatar_url": "https://avatars0.githubusercontent.com/u/3056980?v=4",
1508      "gravatar_id": "",
1509      "url": "https://api.github.com/users/brainwave0",
1510      "html_url": "https://github.com/brainwave0",
1511      "followers_url": "https://api.github.com/users/brainwave0/followers",
1512      "following_url": "https://api.github.com/users/brainwave0/following{/other_user}",
1513      "gists_url": "https://api.github.com/users/brainwave0/gists{/gist_id}",
1514      "starred_url": "https://api.github.com/users/brainwave0/starred{/owner}{/repo}",
1515      "subscriptions_url": "https://api.github.com/users/brainwave0/subscriptions",
1516      "organizations_url": "https://api.github.com/users/brainwave0/orgs",
1517      "repos_url": "https://api.github.com/users/brainwave0/repos",
1518      "events_url": "https://api.github.com/users/brainwave0/events{/privacy}",
1519      "received_events_url": "https://api.github.com/users/brainwave0/received_events",
1520      "type": "User",
1521      "site_admin": false
1522    },
1523    "labels": [
1524
1525    ],
1526    "state": "open",
1527    "locked": false,
1528    "assignee": null,
1529    "assignees": [
1530
1531    ],
1532    "milestone": null,
1533    "comments": 3,
1534    "created_at": "2018-02-12T20:00:41Z",
1535    "updated_at": "2018-02-12T22:11:12Z",
1536    "closed_at": null,
1537    "author_association": "NONE",
1538    "body": "If I try to make an instance for a custom type that includes a UTCTime or a DiffTime, I get a compile error. For example, if I try to compile the folowing code\r\n\r\n    {-# LANGUAGE DeriveGeneric #-}\r\n    import GHC.Generics\r\n    import Data.Aeson\r\n    import Data.Time\r\n    data Foo = Foo UTCTime deriving (Generic, Show)\r\n    instance ToJSON Foo\r\n    instance FromJSON Foo\r\n\r\nI get\r\n\r\n    /home/ian/test.hs:6:10:\r\n        No instance for (ToJSON UTCTime)\r\n          arising from a use of ‘aeson-1.2.4.0:Data.Aeson.Types.ToJSON.$gdmtoJSON’\r\n        In the expression: aeson-1.2.4.0:Data.Aeson.Types.ToJSON.$gdmtoJSON\r\n        In an equation for ‘toJSON’:\r\n            toJSON = aeson-1.2.4.0:Data.Aeson.Types.ToJSON.$gdmtoJSON\r\n        In the instance declaration for ‘ToJSON Foo’\r\n    \r\n    /home/ian/test.hs:7:10:\r\n        No instance for (FromJSON UTCTime)\r\n          arising from a use of ‘aeson-1.2.4.0:Data.Aeson.Types.FromJSON.$gdmparseJSON’\r\n        In the expression:\r\n          aeson-1.2.4.0:Data.Aeson.Types.FromJSON.$gdmparseJSON\r\n        In an equation for ‘parseJSON’:\r\n            parseJSON = aeson-1.2.4.0:Data.Aeson.Types.FromJSON.$gdmparseJSON\r\n        In the instance declaration for ‘FromJSON Foo’"
1539  }
1540]
1541