{"action":"created","issue":{"url":"https://api.github.com/repos/liufengyun/gestalt/issues/60","repository_url":"https://api.github.com/repos/liufengyun/gestalt","labels_url":"https://api.github.com/repos/liufengyun/gestalt/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/liufengyun/gestalt/issues/60/comments","events_url":"https://api.github.com/repos/liufengyun/gestalt/issues/60/events","html_url":"https://github.com/liufengyun/gestalt/issues/60","id":225054099,"number":60,"title":"support TypeTags","user":{"login":"liufengyun","id":754633,"avatar_url":"https://avatars0.githubusercontent.com/u/754633?v=3","gravatar_id":"","url":"https://api.github.com/users/liufengyun","html_url":"https://github.com/liufengyun","followers_url":"https://api.github.com/users/liufengyun/followers","following_url":"https://api.github.com/users/liufengyun/following{/other_user}","gists_url":"https://api.github.com/users/liufengyun/gists{/gist_id}","starred_url":"https://api.github.com/users/liufengyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liufengyun/subscriptions","organizations_url":"https://api.github.com/users/liufengyun/orgs","repos_url":"https://api.github.com/users/liufengyun/repos","events_url":"https://api.github.com/users/liufengyun/events{/privacy}","received_events_url":"https://api.github.com/users/liufengyun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-28T11:29:23Z","updated_at":"2017-04-28T14:44:14Z","closed_at":null,"body":"The Monadless library uses TypeTags:\r\n\r\n```Scala\r\ntrait Monadless[Monad[_]] {\r\n  type M[T] = Monad[T]\r\n\r\n  def lift[T](body: T)(implicit m: WeakTypeTag[Monad[_]]): Monad[T] = meta {  =>\r\n    val tree = Transformer(toolbox)(body) // cannot access M, this.M doesn't help\r\n    toolbox.traverse(tree) {\r\n      case tree @ q\"$pack.unlift[$t]($v)\" =>\r\n        toolbox.error(\"Unsupported unlift position\", tree)\r\n    }\r\n    tree\r\n  }\r\n}\r\n```\r\n\r\nFollowing the extractor approach, TypeBags have to be platform-independent based on abstract types.\r\n\r\n- The macro transform should not change the type of TypeTag parameters\r\n- The dummy toolbox has to be used to declare the type of TypeTag in macro definition\r\n"},"comment":{"url":"https://api.github.com/repos/liufengyun/gestalt/issues/comments/298017347","html_url":"https://github.com/liufengyun/gestalt/issues/60#issuecomment-298017347","issue_url":"https://api.github.com/repos/liufengyun/gestalt/issues/60","id":298017347,"user":{"login":"xeno-by","id":609152,"avatar_url":"https://avatars3.githubusercontent.com/u/609152?v=3","gravatar_id":"","url":"https://api.github.com/users/xeno-by","html_url":"https://github.com/xeno-by","followers_url":"https://api.github.com/users/xeno-by/followers","following_url":"https://api.github.com/users/xeno-by/following{/other_user}","gists_url":"https://api.github.com/users/xeno-by/gists{/gist_id}","starred_url":"https://api.github.com/users/xeno-by/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeno-by/subscriptions","organizations_url":"https://api.github.com/users/xeno-by/orgs","repos_url":"https://api.github.com/users/xeno-by/repos","events_url":"https://api.github.com/users/xeno-by/events{/privacy}","received_events_url":"https://api.github.com/users/xeno-by/received_events","type":"User","site_admin":false},"created_at":"2017-04-28T14:44:14Z","updated_at":"2017-04-28T14:44:14Z","body":"In scala.reflect, typetags in macros are used for two task: 1) to obtain definition-site types instantiated with callsite knowledge, 2) to instantiate types via `typeOf`.\r\n\r\nIn the new macro system, both tasks are achieved by something else. 1) is covered by the fact that we can access types from the definition site inside meta blocks. 2) needs a different API (either termRef/typeRef/... or quasiquotes or something else like primitivizing typeOf).\r\n\r\nConcretely, in this example, both `M` and `Monad` should be accessible inside the meta block by names `M` and `Monad`."}}
{"actor":{"display_login":"xeno-by"}}