{"action":"created","issue":{"url":"https://api.github.com/repos/bos/aeson/issues/278","labels_url":"https://api.github.com/repos/bos/aeson/issues/278/labels{/name}","comments_url":"https://api.github.com/repos/bos/aeson/issues/278/comments","events_url":"https://api.github.com/repos/bos/aeson/issues/278/events","html_url":"https://github.com/bos/aeson/pull/278","id":97362942,"number":278,"title":"Support deriving data families with Template Haskell","user":{"login":"RyanGlScott","id":2364661,"avatar_url":"https://avatars.githubusercontent.com/u/2364661?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanGlScott","html_url":"https://github.com/RyanGlScott","followers_url":"https://api.github.com/users/RyanGlScott/followers","following_url":"https://api.github.com/users/RyanGlScott/following{/other_user}","gists_url":"https://api.github.com/users/RyanGlScott/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanGlScott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanGlScott/subscriptions","organizations_url":"https://api.github.com/users/RyanGlScott/orgs","repos_url":"https://api.github.com/users/RyanGlScott/repos","events_url":"https://api.github.com/users/RyanGlScott/events{/privacy}","received_events_url":"https://api.github.com/users/RyanGlScott/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-27T00:48:07Z","updated_at":"2015-08-11T17:31:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bos/aeson/pulls/278","html_url":"https://github.com/bos/aeson/pull/278","diff_url":"https://github.com/bos/aeson/pull/278.diff","patch_url":"https://github.com/bos/aeson/pull/278.patch"},"body":"`Data.Aeson.TH` currently only supports plain data types. This pull request extends the Template Haskell engine to allow deriving data family instances.\r\n\r\nSince it is impractical to pass an entire data instance's type (e.g., `Family Int a`) to Template Haskell, this works by passing in the name of a data family instance constuctor to `deriveJSON`/`mk-`/etc., which infers the instance it corresponds to:\r\n\r\n```haskell\r\ndata family DF a\r\ndata instance DF Int = DF1 Int\r\n                     | DF2 Int Int\r\n                     deriving Eq\r\n\r\n$(deriveJSON defaultOptions 'DF1)\r\n-- Alternatively, one could pass 'DF2 instead\r\n```"},"comment":{"url":"https://api.github.com/repos/bos/aeson/issues/comments/129980684","html_url":"https://github.com/bos/aeson/pull/278#issuecomment-129980684","issue_url":"https://api.github.com/repos/bos/aeson/issues/278","id":129980684,"user":{"login":"bos","id":23374,"avatar_url":"https://avatars.githubusercontent.com/u/23374?v=3","gravatar_id":"","url":"https://api.github.com/users/bos","html_url":"https://github.com/bos","followers_url":"https://api.github.com/users/bos/followers","following_url":"https://api.github.com/users/bos/following{/other_user}","gists_url":"https://api.github.com/users/bos/gists{/gist_id}","starred_url":"https://api.github.com/users/bos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bos/subscriptions","organizations_url":"https://api.github.com/users/bos/orgs","repos_url":"https://api.github.com/users/bos/repos","events_url":"https://api.github.com/users/bos/events{/privacy}","received_events_url":"https://api.github.com/users/bos/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T17:31:37Z","updated_at":"2015-08-11T17:31:37Z","body":"cc @basvandijk "}}