{"action":"created","comment":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/44563751","id":44563751,"diff_hunk":"@@ -326,66 +266,75 @@ package object sql {\n \n   private val astType = \"AST\" :: Nil\n \n-  implicit def SqlRelationRenderTree[A: RenderTree]: RenderTree[SqlRelation[A]] =\n-    new RenderTree[SqlRelation[A]] {\n-      def render(r: SqlRelation[A]): RenderedTree = r match {\n-        case ExprRelationAST(select, alias) => NonTerminal(\"ExprRelation\" :: astType, Some(\"Expr as \" + alias), select.render :: Nil)\n-        case TableRelationAST(name, Some(alias)) => Terminal(\"TableRelation\" :: astType, Some(name + \" as \" + alias))\n-        case TableRelationAST(name, None)        => Terminal(\"TableRelation\" :: astType, Some(name))\n-        case JoinRelation(left, right, jt, clause) =>\n-          NonTerminal(\"JoinRelation\" :: astType, Some(jt.toString),\n-            List(render(left), render(right), clause.render))\n+  implicit def SqlRelationRenderTree: RenderTree ~> λ[α => RenderTree[SqlRelation[α]]] =\n+    new (RenderTree ~> λ[α => RenderTree[SqlRelation[α]]]) {\n+      def apply[α](ra: RenderTree[α]) = new RenderTree[SqlRelation[α]] {\n+        def render(r: SqlRelation[α]): RenderedTree = r match {\n+          case ExprRelationAST(select, alias) => NonTerminal(\"ExprRelation\" :: astType, Some(\"Expr as \" + alias), ra.render(select) :: Nil)\n+          case TableRelationAST(name, Some(alias)) => Terminal(\"TableRelation\" :: astType, Some(name + \" as \" + alias))\n+          case TableRelationAST(name, None)        => Terminal(\"TableRelation\" :: astType, Some(name))\n+          case JoinRelation(left, right, jt, clause) =>\n+            NonTerminal(\"JoinRelation\" :: astType, Some(jt.toString),\n+              List(render(left), render(right), ra.render(clause)))\n+        }\n       }\n     }\n \n-  implicit val ExprRenderTree: RenderTree[Expr] = new RenderTree[Expr] {\n-    def renderCase(c: Case[Expr]): RenderedTree =\n-      NonTerminal(\"Case\" :: astType, None, render(c.cond) :: render(c.expr) :: Nil)\n-\n-    def render(n: Expr) = n match {\n-      case Select(isDistinct, projections, relations, filter, groupBy, orderBy) =>\n-        val nt = \"Select\" :: astType\n-        NonTerminal(nt,\n-          isDistinct match { case `SelectDistinct` => Some(\"distinct\"); case _ => None },\n-          projections.map { p =>\n-            NonTerminal(\"Proj\" :: astType, p.alias, render(p.expr) :: Nil)\n-          } ⊹\n-            (relations.map(_.render) ::\n-              filter.map(f => render(f)) ::\n-              groupBy.map {\n-                case GroupBy(keys, Some(having)) => NonTerminal(\"GroupBy\" :: astType, None, keys.map(render(_)) :+ render(having))\n-                case GroupBy(keys, None)         => NonTerminal(\"GroupBy\" :: astType, None, keys.map(render(_)))\n-              } ::\n-              orderBy.map {\n-                case OrderBy(keys) =>\n-                  val nt = \"OrderBy\" :: astType\n-                  NonTerminal(nt, None,\n-                    keys.map { case (t, x) => NonTerminal(\"OrderType\" :: nt, Some(t.toString), render(x) :: Nil)})\n-              } ::\n-              Nil).foldMap(_.toList))\n-\n-      case SetLiteral(exprs) => NonTerminal(\"Set\" :: astType, None, exprs.map(render(_)))\n-      case ArrayLiteral(exprs) => NonTerminal(\"Array\" :: astType, None, exprs.map(render(_)))\n-\n-      case InvokeFunction(name, args) => NonTerminal(\"InvokeFunction\" :: astType, Some(name), args.map(render(_)))\n-\n-      case Match(expr, cases, Some(default)) => NonTerminal(\"Match\" :: astType, None, render(expr) :: (cases.map(renderCase) :+ render(default)))\n-      case Match(expr, cases, None)          => NonTerminal(\"Match\" :: astType, None, render(expr) :: cases.map(renderCase))\n-\n-      case Switch(cases, Some(default)) => NonTerminal(\"Switch\" :: astType, None, cases.map(renderCase) :+ render(default))\n-      case Switch(cases, None)          => NonTerminal(\"Switch\" :: astType, None, cases.map(renderCase))\n-\n-      case Binop(lhs, rhs, op) => NonTerminal(\"Binop\" :: astType, Some(op.toString), render(lhs) :: render(rhs) :: Nil)\n-\n-      case Unop(expr, op) => NonTerminal(\"Unop\" :: astType, Some(op.sql), render(expr) :: Nil)\n-\n-      case Splice(expr) => NonTerminal(\"Splice\" :: astType, None, expr.toList.map(render(_)))\n-\n-      case Ident(name) => Terminal(\"Ident\" :: astType, Some(name))\n-\n-      case Vari(name) => Terminal(\"Variable\" :: astType, Some(\":\" + name))\n-\n-      case x => Terminal(\"LiteralExpr\" :: astType, Some(pprint(x)))\n+  implicit val ExprFRenderTree: RenderTree ~> λ[α => RenderTree[ExprF[α]]] =","path":"core/src/main/scala/quasar/sql/package.scala","position":218,"original_position":218,"commit_id":"b95ade76db1d44591d59b07a21f3810d964bfd15","original_commit_id":"b95ade76db1d44591d59b07a21f3810d964bfd15","user":{"login":"mossprescott","id":6147371,"avatar_url":"https://avatars.githubusercontent.com/u/6147371?v=3","gravatar_id":"","url":"https://api.github.com/users/mossprescott","html_url":"https://github.com/mossprescott","followers_url":"https://api.github.com/users/mossprescott/followers","following_url":"https://api.github.com/users/mossprescott/following{/other_user}","gists_url":"https://api.github.com/users/mossprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mossprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossprescott/subscriptions","organizations_url":"https://api.github.com/users/mossprescott/orgs","repos_url":"https://api.github.com/users/mossprescott/repos","events_url":"https://api.github.com/users/mossprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mossprescott/received_events","type":"User","site_admin":false},"body":"??? Should this type be making any sense to me?\r\n\r\nI would have expected `def ExprFRenderTree[A]: RenderTree[ExprF[A]]`. I guess I'm missing something, or is this doing more than that would?","created_at":"2015-11-11T18:02:31Z","updated_at":"2015-11-11T18:02:31Z","html_url":"https://github.com/quasar-analytics/quasar/pull/984#discussion_r44563751","pull_request_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984","_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/44563751"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/984#discussion_r44563751"},"pull_request":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984"}}},"pull_request":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984","id":50342098,"html_url":"https://github.com/quasar-analytics/quasar/pull/984","diff_url":"https://github.com/quasar-analytics/quasar/pull/984.diff","patch_url":"https://github.com/quasar-analytics/quasar/pull/984.patch","issue_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/984","number":984,"state":"open","locked":false,"title":"Kill AnnotatedTree.","user":{"login":"sellout","id":33031,"avatar_url":"https://avatars.githubusercontent.com/u/33031?v=3","gravatar_id":"","url":"https://api.github.com/users/sellout","html_url":"https://github.com/sellout","followers_url":"https://api.github.com/users/sellout/followers","following_url":"https://api.github.com/users/sellout/following{/other_user}","gists_url":"https://api.github.com/users/sellout/gists{/gist_id}","starred_url":"https://api.github.com/users/sellout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellout/subscriptions","organizations_url":"https://api.github.com/users/sellout/orgs","repos_url":"https://api.github.com/users/sellout/repos","events_url":"https://api.github.com/users/sellout/events{/privacy}","received_events_url":"https://api.github.com/users/sellout/received_events","type":"User","site_admin":false},"body":"Reimplement analyses and compilation as [un]folds.\r\n\r\nAlso, added Elgot folds and generalized a few other recursionscheme\r\noperations; took some advantage of @tpolecat’s kinda-curried type\r\nparameters approach to make the type annotations less onerous; and\r\ngeneralized RenderTree instanecs to work over any type, not just\r\nrecursive ones.","created_at":"2015-11-11T02:47:58Z","updated_at":"2015-11-11T18:02:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb321b42d69dd195099543899fb4bca912697c1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984/commits","review_comments_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984/comments","review_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/984/comments","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/b95ade76db1d44591d59b07a21f3810d964bfd15","head":{"label":"sellout:wip/SD-1101-kill-AnnotatedTree","ref":"wip/SD-1101-kill-AnnotatedTree","sha":"b95ade76db1d44591d59b07a21f3810d964bfd15","user":{"login":"sellout","id":33031,"avatar_url":"https://avatars.githubusercontent.com/u/33031?v=3","gravatar_id":"","url":"https://api.github.com/users/sellout","html_url":"https://github.com/sellout","followers_url":"https://api.github.com/users/sellout/followers","following_url":"https://api.github.com/users/sellout/following{/other_user}","gists_url":"https://api.github.com/users/sellout/gists{/gist_id}","starred_url":"https://api.github.com/users/sellout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellout/subscriptions","organizations_url":"https://api.github.com/users/sellout/orgs","repos_url":"https://api.github.com/users/sellout/repos","events_url":"https://api.github.com/users/sellout/events{/privacy}","received_events_url":"https://api.github.com/users/sellout/received_events","type":"User","site_admin":false},"repo":{"id":21178230,"name":"slamengine","full_name":"sellout/slamengine","owner":{"login":"sellout","id":33031,"avatar_url":"https://avatars.githubusercontent.com/u/33031?v=3","gravatar_id":"","url":"https://api.github.com/users/sellout","html_url":"https://github.com/sellout","followers_url":"https://api.github.com/users/sellout/followers","following_url":"https://api.github.com/users/sellout/following{/other_user}","gists_url":"https://api.github.com/users/sellout/gists{/gist_id}","starred_url":"https://api.github.com/users/sellout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellout/subscriptions","organizations_url":"https://api.github.com/users/sellout/orgs","repos_url":"https://api.github.com/users/sellout/repos","events_url":"https://api.github.com/users/sellout/events{/privacy}","received_events_url":"https://api.github.com/users/sellout/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sellout/slamengine","description":"The engine for SlamData","fork":true,"url":"https://api.github.com/repos/sellout/slamengine","forks_url":"https://api.github.com/repos/sellout/slamengine/forks","keys_url":"https://api.github.com/repos/sellout/slamengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sellout/slamengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sellout/slamengine/teams","hooks_url":"https://api.github.com/repos/sellout/slamengine/hooks","issue_events_url":"https://api.github.com/repos/sellout/slamengine/issues/events{/number}","events_url":"https://api.github.com/repos/sellout/slamengine/events","assignees_url":"https://api.github.com/repos/sellout/slamengine/assignees{/user}","branches_url":"https://api.github.com/repos/sellout/slamengine/branches{/branch}","tags_url":"https://api.github.com/repos/sellout/slamengine/tags","blobs_url":"https://api.github.com/repos/sellout/slamengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sellout/slamengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sellout/slamengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/sellout/slamengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sellout/slamengine/statuses/{sha}","languages_url":"https://api.github.com/repos/sellout/slamengine/languages","stargazers_url":"https://api.github.com/repos/sellout/slamengine/stargazers","contributors_url":"https://api.github.com/repos/sellout/slamengine/contributors","subscribers_url":"https://api.github.com/repos/sellout/slamengine/subscribers","subscription_url":"https://api.github.com/repos/sellout/slamengine/subscription","commits_url":"https://api.github.com/repos/sellout/slamengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/sellout/slamengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/sellout/slamengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/sellout/slamengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/sellout/slamengine/contents/{+path}","compare_url":"https://api.github.com/repos/sellout/slamengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sellout/slamengine/merges","archive_url":"https://api.github.com/repos/sellout/slamengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sellout/slamengine/downloads","issues_url":"https://api.github.com/repos/sellout/slamengine/issues{/number}","pulls_url":"https://api.github.com/repos/sellout/slamengine/pulls{/number}","milestones_url":"https://api.github.com/repos/sellout/slamengine/milestones{/number}","notifications_url":"https://api.github.com/repos/sellout/slamengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sellout/slamengine/labels{/name}","releases_url":"https://api.github.com/repos/sellout/slamengine/releases{/id}","created_at":"2014-06-24T19:38:07Z","updated_at":"2014-09-08T15:39:05Z","pushed_at":"2015-11-11T02:43:38Z","git_url":"git://github.com/sellout/slamengine.git","ssh_url":"git@github.com:sellout/slamengine.git","clone_url":"https://github.com/sellout/slamengine.git","svn_url":"https://github.com/sellout/slamengine","homepage":null,"size":9276,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"quasar-analytics:master","ref":"master","sha":"0a3a7bc95ec00943d862b5d9cc9117ed754aa479","user":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"repo":{"id":16515058,"name":"quasar","full_name":"quasar-analytics/quasar","owner":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quasar-analytics/quasar","description":"A NoSQL analytics engine that embraces post-relational analytics and pushes computation to the data.","fork":false,"url":"https://api.github.com/repos/quasar-analytics/quasar","forks_url":"https://api.github.com/repos/quasar-analytics/quasar/forks","keys_url":"https://api.github.com/repos/quasar-analytics/quasar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quasar-analytics/quasar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quasar-analytics/quasar/teams","hooks_url":"https://api.github.com/repos/quasar-analytics/quasar/hooks","issue_events_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/events{/number}","events_url":"https://api.github.com/repos/quasar-analytics/quasar/events","assignees_url":"https://api.github.com/repos/quasar-analytics/quasar/assignees{/user}","branches_url":"https://api.github.com/repos/quasar-analytics/quasar/branches{/branch}","tags_url":"https://api.github.com/repos/quasar-analytics/quasar/tags","blobs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quasar-analytics/quasar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/refs{/sha}","trees_url":"https://api.github.com/repos/quasar-analytics/quasar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/{sha}","languages_url":"https://api.github.com/repos/quasar-analytics/quasar/languages","stargazers_url":"https://api.github.com/repos/quasar-analytics/quasar/stargazers","contributors_url":"https://api.github.com/repos/quasar-analytics/quasar/contributors","subscribers_url":"https://api.github.com/repos/quasar-analytics/quasar/subscribers","subscription_url":"https://api.github.com/repos/quasar-analytics/quasar/subscription","commits_url":"https://api.github.com/repos/quasar-analytics/quasar/commits{/sha}","git_commits_url":"https://api.github.com/repos/quasar-analytics/quasar/git/commits{/sha}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/comments{/number}","issue_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/comments{/number}","contents_url":"https://api.github.com/repos/quasar-analytics/quasar/contents/{+path}","compare_url":"https://api.github.com/repos/quasar-analytics/quasar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quasar-analytics/quasar/merges","archive_url":"https://api.github.com/repos/quasar-analytics/quasar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quasar-analytics/quasar/downloads","issues_url":"https://api.github.com/repos/quasar-analytics/quasar/issues{/number}","pulls_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls{/number}","milestones_url":"https://api.github.com/repos/quasar-analytics/quasar/milestones{/number}","notifications_url":"https://api.github.com/repos/quasar-analytics/quasar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quasar-analytics/quasar/labels{/name}","releases_url":"https://api.github.com/repos/quasar-analytics/quasar/releases{/id}","created_at":"2014-02-04T15:01:27Z","updated_at":"2015-11-05T21:42:22Z","pushed_at":"2015-11-11T02:47:59Z","git_url":"git://github.com/quasar-analytics/quasar.git","ssh_url":"git@github.com:quasar-analytics/quasar.git","clone_url":"https://github.com/quasar-analytics/quasar.git","svn_url":"https://github.com/quasar-analytics/quasar","homepage":"","size":11769,"stargazers_count":162,"watchers_count":162,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":160,"forks":38,"open_issues":160,"watchers":162,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/984"},"issue":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/984"},"comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/984/comments"},"review_comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984/comments"},"review_comment":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/984/commits"},"statuses":{"href":"https://api.github.com/repos/quasar-analytics/quasar/statuses/b95ade76db1d44591d59b07a21f3810d964bfd15"}}}}