{"action":"created","comment":{"url":"https://api.github.com/repos/hablapps/shapelens/pulls/comments/205697587","pull_request_review_id":141018448,"id":205697587,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTY5NzU4Nw==","diff_hunk":"@@ -0,0 +1,48 @@\n+package shapelens\n+\n+import cats.{~>, Id, Eval}\n+import cats.data.{Reader => CReader, State}\n+\n+trait NatTrans[P[_], Q[_]]{\n+  val nat: P ~> Q\n+}\n+\n+object NatTrans{\n+\n+  implicit def SurfaceGetterNatTrans[E2, E1](implicit\n+      S: SurfaceGetter[Id, E2, E1]) =\n+    new NatTrans[CReader[E1,?], CReader[E2,?]]{\n+      val nat = S.apply\n+    }\n+\n+  implicit def SurfaceLensNatTrans[E2, E1](implicit\n+      S: SurfaceLens[Eval, E2, E1]) =\n+    new NatTrans[State[E1,?], State[E2,?]]{\n+      val nat = S.apply\n+    }\n+\n+  implicit def KleisliToStateTNatTrans[E1, E2](implicit\n+      K: KleisliToStateT[Id, E2, E1]) =\n+    new NatTrans[CReader[E1,?], State[E2,?]]{\n+      val nat = λ[CReader[E1,?] ~> State[E2,?]]{\n+        p => K.apply(p).transformF(cats.Eval.now)\n+      }\n+    }\n+\n+  implicit def IdToOptionNatTrans =\n+    new NatTrans[cats.Id, Option]{\n+      val nat = λ[cats.Id ~> Option](x => Option(x))\n+    }\n+}\n+\n+trait NatTransLPI{\n+\n+  implicit def composition[P[_], Q[_], R[_]](implicit\n+      PQ: NatTrans[P,Q],\n+      QR: NatTrans[Q,R]) =\n+    new NatTrans[P, R]{\n+      val nat: P ~> R = λ[P ~> R]{\n+        p => QR.nat(PQ.nat(p))\n+      }\n+    }","path":"src/main/scala/NatTrans.scala","position":47,"original_position":47,"commit_id":"a49619b3d0e0073483c1ab3fe5eddaa615c3e13d","original_commit_id":"a49619b3d0e0073483c1ab3fe5eddaa615c3e13d","user":{"login":"jeslg","id":3339005,"node_id":"MDQ6VXNlcjMzMzkwMDU=","avatar_url":"https://avatars3.githubusercontent.com/u/3339005?v=4","gravatar_id":"","url":"https://api.github.com/users/jeslg","html_url":"https://github.com/jeslg","followers_url":"https://api.github.com/users/jeslg/followers","following_url":"https://api.github.com/users/jeslg/following{/other_user}","gists_url":"https://api.github.com/users/jeslg/gists{/gist_id}","starred_url":"https://api.github.com/users/jeslg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeslg/subscriptions","organizations_url":"https://api.github.com/users/jeslg/orgs","repos_url":"https://api.github.com/users/jeslg/repos","events_url":"https://api.github.com/users/jeslg/events{/privacy}","received_events_url":"https://api.github.com/users/jeslg/received_events","type":"User","site_admin":false},"body":"Why not using `compose`?","created_at":"2018-07-27T08:09:05Z","updated_at":"2018-07-27T08:14:21Z","html_url":"https://github.com/hablapps/shapelens/pull/4#discussion_r205697587","pull_request_url":"https://api.github.com/repos/hablapps/shapelens/pulls/4","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/hablapps/shapelens/pulls/comments/205697587"},"html":{"href":"https://github.com/hablapps/shapelens/pull/4#discussion_r205697587"},"pull_request":{"href":"https://api.github.com/repos/hablapps/shapelens/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/hablapps/shapelens/pulls/4","id":204197629,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MTk3NjI5","html_url":"https://github.com/hablapps/shapelens/pull/4","diff_url":"https://github.com/hablapps/shapelens/pull/4.diff","patch_url":"https://github.com/hablapps/shapelens/pull/4.patch","issue_url":"https://api.github.com/repos/hablapps/shapelens/issues/4","number":4,"state":"open","locked":false,"title":"Surface lenses & getters","user":{"login":"jserranohidalgo","id":3715323,"node_id":"MDQ6VXNlcjM3MTUzMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/3715323?v=4","gravatar_id":"","url":"https://api.github.com/users/jserranohidalgo","html_url":"https://github.com/jserranohidalgo","followers_url":"https://api.github.com/users/jserranohidalgo/followers","following_url":"https://api.github.com/users/jserranohidalgo/following{/other_user}","gists_url":"https://api.github.com/users/jserranohidalgo/gists{/gist_id}","starred_url":"https://api.github.com/users/jserranohidalgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jserranohidalgo/subscriptions","organizations_url":"https://api.github.com/users/jserranohidalgo/orgs","repos_url":"https://api.github.com/users/jserranohidalgo/repos","events_url":"https://api.github.com/users/jserranohidalgo/events{/privacy}","received_events_url":"https://api.github.com/users/jserranohidalgo/received_events","type":"User","site_admin":false},"body":"This PR provides a number of natural transformations useful for instantiating type classes in any MTL-based application.\r\n\r\nWe have natural transformations for lifting 1) reader monads into reader monads, 2) state monads into state monads, and, 3), reader monads into state monads. \r\n\r\nThe third transformation should be derived modularly, in terms of more general transformations (hoist for StateT or ReaderT).\r\n\r\nNaming should also be discussed (but implemented in forthcoming PRs): e.g. `SurfaceGetter` => `SurfaceKleisliToKleisli`, etc. This would correspond more closely to the `KleisliToSTateT` transformation.\r\n\r\nAlso, we should evaluate the possibility of extending the `NatTrans` type class by the particular types of transformations, instead of deriving implicit instances for each of them.\r\n\r\nMonocle abstractions (just `Getter`, although the same should be done for obtaining a surface monocle `Lens`) has been packaged into the `monocle` package. \r\n\r\nAdded support for cross compilation to 2.10.\r\n\r\nThe project is now published in sonatype. Instructions can be found [here](https://hablapps.atlassian.net/browse/SPEECH-215)","created_at":"2018-07-26T16:25:44Z","updated_at":"2018-07-27T08:14:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cf86489ee8e58e98d3114ed37fd2b00401fbfa7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hablapps/shapelens/pulls/4/commits","review_comments_url":"https://api.github.com/repos/hablapps/shapelens/pulls/4/comments","review_comment_url":"https://api.github.com/repos/hablapps/shapelens/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hablapps/shapelens/issues/4/comments","statuses_url":"https://api.github.com/repos/hablapps/shapelens/statuses/a49619b3d0e0073483c1ab3fe5eddaa615c3e13d","head":{"label":"hablapps:feature/lenses","ref":"feature/lenses","sha":"a49619b3d0e0073483c1ab3fe5eddaa615c3e13d","user":{"login":"hablapps","id":3510687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MTA2ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/3510687?v=4","gravatar_id":"","url":"https://api.github.com/users/hablapps","html_url":"https://github.com/hablapps","followers_url":"https://api.github.com/users/hablapps/followers","following_url":"https://api.github.com/users/hablapps/following{/other_user}","gists_url":"https://api.github.com/users/hablapps/gists{/gist_id}","starred_url":"https://api.github.com/users/hablapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hablapps/subscriptions","organizations_url":"https://api.github.com/users/hablapps/orgs","repos_url":"https://api.github.com/users/hablapps/repos","events_url":"https://api.github.com/users/hablapps/events{/privacy}","received_events_url":"https://api.github.com/users/hablapps/received_events","type":"Organization","site_admin":false},"repo":{"id":140594397,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA1OTQzOTc=","name":"shapelens","full_name":"hablapps/shapelens","owner":{"login":"hablapps","id":3510687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MTA2ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/3510687?v=4","gravatar_id":"","url":"https://api.github.com/users/hablapps","html_url":"https://github.com/hablapps","followers_url":"https://api.github.com/users/hablapps/followers","following_url":"https://api.github.com/users/hablapps/following{/other_user}","gists_url":"https://api.github.com/users/hablapps/gists{/gist_id}","starred_url":"https://api.github.com/users/hablapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hablapps/subscriptions","organizations_url":"https://api.github.com/users/hablapps/orgs","repos_url":"https://api.github.com/users/hablapps/repos","events_url":"https://api.github.com/users/hablapps/events{/privacy}","received_events_url":"https://api.github.com/users/hablapps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hablapps/shapelens","description":"Generating implicit lenses with Shapeless","fork":false,"url":"https://api.github.com/repos/hablapps/shapelens","forks_url":"https://api.github.com/repos/hablapps/shapelens/forks","keys_url":"https://api.github.com/repos/hablapps/shapelens/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hablapps/shapelens/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hablapps/shapelens/teams","hooks_url":"https://api.github.com/repos/hablapps/shapelens/hooks","issue_events_url":"https://api.github.com/repos/hablapps/shapelens/issues/events{/number}","events_url":"https://api.github.com/repos/hablapps/shapelens/events","assignees_url":"https://api.github.com/repos/hablapps/shapelens/assignees{/user}","branches_url":"https://api.github.com/repos/hablapps/shapelens/branches{/branch}","tags_url":"https://api.github.com/repos/hablapps/shapelens/tags","blobs_url":"https://api.github.com/repos/hablapps/shapelens/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hablapps/shapelens/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hablapps/shapelens/git/refs{/sha}","trees_url":"https://api.github.com/repos/hablapps/shapelens/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hablapps/shapelens/statuses/{sha}","languages_url":"https://api.github.com/repos/hablapps/shapelens/languages","stargazers_url":"https://api.github.com/repos/hablapps/shapelens/stargazers","contributors_url":"https://api.github.com/repos/hablapps/shapelens/contributors","subscribers_url":"https://api.github.com/repos/hablapps/shapelens/subscribers","subscription_url":"https://api.github.com/repos/hablapps/shapelens/subscription","commits_url":"https://api.github.com/repos/hablapps/shapelens/commits{/sha}","git_commits_url":"https://api.github.com/repos/hablapps/shapelens/git/commits{/sha}","comments_url":"https://api.github.com/repos/hablapps/shapelens/comments{/number}","issue_comment_url":"https://api.github.com/repos/hablapps/shapelens/issues/comments{/number}","contents_url":"https://api.github.com/repos/hablapps/shapelens/contents/{+path}","compare_url":"https://api.github.com/repos/hablapps/shapelens/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hablapps/shapelens/merges","archive_url":"https://api.github.com/repos/hablapps/shapelens/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hablapps/shapelens/downloads","issues_url":"https://api.github.com/repos/hablapps/shapelens/issues{/number}","pulls_url":"https://api.github.com/repos/hablapps/shapelens/pulls{/number}","milestones_url":"https://api.github.com/repos/hablapps/shapelens/milestones{/number}","notifications_url":"https://api.github.com/repos/hablapps/shapelens/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hablapps/shapelens/labels{/name}","releases_url":"https://api.github.com/repos/hablapps/shapelens/releases{/id}","deployments_url":"https://api.github.com/repos/hablapps/shapelens/deployments","created_at":"2018-07-11T15:24:25Z","updated_at":"2018-07-26T11:19:38Z","pushed_at":"2018-07-27T07:51:12Z","git_url":"git://github.com/hablapps/shapelens.git","ssh_url":"git@github.com:hablapps/shapelens.git","clone_url":"https://github.com/hablapps/shapelens.git","svn_url":"https://github.com/hablapps/shapelens","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hablapps:master","ref":"master","sha":"8febd67ad349b156887d5e282ffb21d2887ada25","user":{"login":"hablapps","id":3510687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MTA2ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/3510687?v=4","gravatar_id":"","url":"https://api.github.com/users/hablapps","html_url":"https://github.com/hablapps","followers_url":"https://api.github.com/users/hablapps/followers","following_url":"https://api.github.com/users/hablapps/following{/other_user}","gists_url":"https://api.github.com/users/hablapps/gists{/gist_id}","starred_url":"https://api.github.com/users/hablapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hablapps/subscriptions","organizations_url":"https://api.github.com/users/hablapps/orgs","repos_url":"https://api.github.com/users/hablapps/repos","events_url":"https://api.github.com/users/hablapps/events{/privacy}","received_events_url":"https://api.github.com/users/hablapps/received_events","type":"Organization","site_admin":false},"repo":{"id":140594397,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA1OTQzOTc=","name":"shapelens","full_name":"hablapps/shapelens","owner":{"login":"hablapps","id":3510687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MTA2ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/3510687?v=4","gravatar_id":"","url":"https://api.github.com/users/hablapps","html_url":"https://github.com/hablapps","followers_url":"https://api.github.com/users/hablapps/followers","following_url":"https://api.github.com/users/hablapps/following{/other_user}","gists_url":"https://api.github.com/users/hablapps/gists{/gist_id}","starred_url":"https://api.github.com/users/hablapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hablapps/subscriptions","organizations_url":"https://api.github.com/users/hablapps/orgs","repos_url":"https://api.github.com/users/hablapps/repos","events_url":"https://api.github.com/users/hablapps/events{/privacy}","received_events_url":"https://api.github.com/users/hablapps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hablapps/shapelens","description":"Generating implicit lenses with Shapeless","fork":false,"url":"https://api.github.com/repos/hablapps/shapelens","forks_url":"https://api.github.com/repos/hablapps/shapelens/forks","keys_url":"https://api.github.com/repos/hablapps/shapelens/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hablapps/shapelens/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hablapps/shapelens/teams","hooks_url":"https://api.github.com/repos/hablapps/shapelens/hooks","issue_events_url":"https://api.github.com/repos/hablapps/shapelens/issues/events{/number}","events_url":"https://api.github.com/repos/hablapps/shapelens/events","assignees_url":"https://api.github.com/repos/hablapps/shapelens/assignees{/user}","branches_url":"https://api.github.com/repos/hablapps/shapelens/branches{/branch}","tags_url":"https://api.github.com/repos/hablapps/shapelens/tags","blobs_url":"https://api.github.com/repos/hablapps/shapelens/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hablapps/shapelens/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hablapps/shapelens/git/refs{/sha}","trees_url":"https://api.github.com/repos/hablapps/shapelens/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hablapps/shapelens/statuses/{sha}","languages_url":"https://api.github.com/repos/hablapps/shapelens/languages","stargazers_url":"https://api.github.com/repos/hablapps/shapelens/stargazers","contributors_url":"https://api.github.com/repos/hablapps/shapelens/contributors","subscribers_url":"https://api.github.com/repos/hablapps/shapelens/subscribers","subscription_url":"https://api.github.com/repos/hablapps/shapelens/subscription","commits_url":"https://api.github.com/repos/hablapps/shapelens/commits{/sha}","git_commits_url":"https://api.github.com/repos/hablapps/shapelens/git/commits{/sha}","comments_url":"https://api.github.com/repos/hablapps/shapelens/comments{/number}","issue_comment_url":"https://api.github.com/repos/hablapps/shapelens/issues/comments{/number}","contents_url":"https://api.github.com/repos/hablapps/shapelens/contents/{+path}","compare_url":"https://api.github.com/repos/hablapps/shapelens/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hablapps/shapelens/merges","archive_url":"https://api.github.com/repos/hablapps/shapelens/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hablapps/shapelens/downloads","issues_url":"https://api.github.com/repos/hablapps/shapelens/issues{/number}","pulls_url":"https://api.github.com/repos/hablapps/shapelens/pulls{/number}","milestones_url":"https://api.github.com/repos/hablapps/shapelens/milestones{/number}","notifications_url":"https://api.github.com/repos/hablapps/shapelens/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hablapps/shapelens/labels{/name}","releases_url":"https://api.github.com/repos/hablapps/shapelens/releases{/id}","deployments_url":"https://api.github.com/repos/hablapps/shapelens/deployments","created_at":"2018-07-11T15:24:25Z","updated_at":"2018-07-26T11:19:38Z","pushed_at":"2018-07-27T07:51:12Z","git_url":"git://github.com/hablapps/shapelens.git","ssh_url":"git@github.com:hablapps/shapelens.git","clone_url":"https://github.com/hablapps/shapelens.git","svn_url":"https://github.com/hablapps/shapelens","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hablapps/shapelens/pulls/4"},"html":{"href":"https://github.com/hablapps/shapelens/pull/4"},"issue":{"href":"https://api.github.com/repos/hablapps/shapelens/issues/4"},"comments":{"href":"https://api.github.com/repos/hablapps/shapelens/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/hablapps/shapelens/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/hablapps/shapelens/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hablapps/shapelens/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/hablapps/shapelens/statuses/a49619b3d0e0073483c1ab3fe5eddaa615c3e13d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jeslg"}}