{"action":"created","issue":{"url":"https://api.github.com/repos/ekmett/bound/issues/13","labels_url":"https://api.github.com/repos/ekmett/bound/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/ekmett/bound/issues/13/comments","events_url":"https://api.github.com/repos/ekmett/bound/issues/13/events","html_url":"https://github.com/ekmett/bound/pull/13","id":96955578,"number":13,"title":"Added Bound.TH","user":{"login":"Icelandjack","id":501899,"avatar_url":"https://avatars.githubusercontent.com/u/501899?v=3","gravatar_id":"","url":"https://api.github.com/users/Icelandjack","html_url":"https://github.com/Icelandjack","followers_url":"https://api.github.com/users/Icelandjack/followers","following_url":"https://api.github.com/users/Icelandjack/following{/other_user}","gists_url":"https://api.github.com/users/Icelandjack/gists{/gist_id}","starred_url":"https://api.github.com/users/Icelandjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Icelandjack/subscriptions","organizations_url":"https://api.github.com/users/Icelandjack/orgs","repos_url":"https://api.github.com/users/Icelandjack/repos","events_url":"https://api.github.com/users/Icelandjack/events{/privacy}","received_events_url":"https://api.github.com/users/Icelandjack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-24T03:36:28Z","updated_at":"2015-10-03T10:57:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ekmett/bound/pulls/13","html_url":"https://github.com/ekmett/bound/pull/13","diff_url":"https://github.com/ekmett/bound/pull/13.diff","patch_url":"https://github.com/ekmett/bound/pull/13.patch"},"body":"As discussed, Template Haskell for deriving Applicative/Monad instances, Eq and Ord are problematic but may be generated as well, discussed in comments. This allows writing:\r\n\r\n```haskell\r\ndata Exp a = V a | App (Exp a) (Exp a) | Lam (Scope () Exp a)\r\n  deriving (Show, Functor)\r\n\r\ninstance Show1 Exp\r\ninstance Eq1 Exp\r\nderiving instance Eq a => Eq (Exp a)\r\ninstance Ord1 Exp\r\nderiving instance Ord a => Ord (Exp a) \r\nmakeBound ''Exp\r\n```\r\n\r\n\r\nThis is a start, it doesn't work on differently kinded types nor does it deal with lists or Functors so\r\n\r\n```haskell\r\ndata Exp a = ... \r\n  | Let {-# UNPACK #-} !Int [Scope Int Exp a] (Scope Int Exp a)\r\n  | Case (Exp a) [Alt Exp a]\r\n```\r\n\r\nwon't fly.\r\n\r\n`makeBound` may be a poor name since I might add a quotation that derive instance of the `Bound` class"},"comment":{"url":"https://api.github.com/repos/ekmett/bound/issues/comments/145236705","html_url":"https://github.com/ekmett/bound/pull/13#issuecomment-145236705","issue_url":"https://api.github.com/repos/ekmett/bound/issues/13","id":145236705,"user":{"login":"Icelandjack","id":501899,"avatar_url":"https://avatars.githubusercontent.com/u/501899?v=3","gravatar_id":"","url":"https://api.github.com/users/Icelandjack","html_url":"https://github.com/Icelandjack","followers_url":"https://api.github.com/users/Icelandjack/followers","following_url":"https://api.github.com/users/Icelandjack/following{/other_user}","gists_url":"https://api.github.com/users/Icelandjack/gists{/gist_id}","starred_url":"https://api.github.com/users/Icelandjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Icelandjack/subscriptions","organizations_url":"https://api.github.com/users/Icelandjack/orgs","repos_url":"https://api.github.com/users/Icelandjack/repos","events_url":"https://api.github.com/users/Icelandjack/events{/privacy}","received_events_url":"https://api.github.com/users/Icelandjack/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T10:57:24Z","updated_at":"2015-10-03T10:57:24Z","body":"Seems to be working"}}