GitHub PullRequestReviewCommentEvent at 2014-08-26 09:36:28
Repository: Monocle
Actor: NightRa
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/comments/16704155","id":16704155,"diff_hunk":"@@ -1,37 +1,71 @@\n package monocle\n \n-import monocle.internal.{Strong, ProChoice}\n+import monocle.internal.{Tagged, Strong, ProChoice}\n \n-import scalaz.{Applicative, Functor, Profunctor}\n+import scalaz.{Applicative, Functor, Profunctor, Monoid, Const}\n import scalaz.std.function._\n import scalaz.Id.Id\n \n /**\n  * An Iso is a Lens that can be reversed and so it defines an isomorphism.\n  */\n-trait Iso[S, T, A, B] extends Lens[S, T, A, B] with Prism[S, T, A, B] { self =>\n+abstract class Iso[S, T, A, B] { self =>\n \n   def _iso[P[_, _]: Profunctor, F[_]: Functor](pafb: P[A, F[B]]): P[S, F[T]]\n \n-  def _lens[P[_, _] : Strong](pab: P[A, B]): P[S, T] = _iso[P, Id](pab)\n+  final def reverse: Iso[B, A, T, S] = Iso[B, A, T, S](reverseGet, get)\n \n-  final def _prism[P[_, _]: ProChoice, F[_]: Applicative](pafb: P[A, F[B]]): P[S, F[T]] =\n-    _iso(pafb)\n+  final def get(s: S): A = _iso[Function1, ({ type l[a] = Const[A, a] })#l](a => Const(a)).apply(s).getConst\n+  final def reverseGet(b: B): T = _iso[Tagged, Id](Tagged(b)).untagged\n \n-  // need to override because of conflicting inheritance\n-  final override def _traversal[F[_] : Applicative](s: S, f: A => F[B]): F[T] =\n-    _iso[Function1, F](f).apply(s)\n+  final def modifyF(f: A => B): S => T = _iso[Function1, Id](f)\n+  final def modify(s: S, f: A => B): T = modifyF(f)(s)\n \n-  final def reverse: Iso[B, A, T, S] = Iso[B, A, T, S](reverseGet, get)\n+  final def set(s: S, newValue: B): T = setF(newValue)(s)\n+  final def setF(newValue: B): S => T = modifyF(_ => newValue)\n \n-  /** non overloaded compose function */\n+\n+  // Compose\n+  final def composeFold[C](other: Fold[A, C]): Fold[S, C] = asFold composeFold other\n+  final def composeGetter[C](other: Getter[A, C]): Getter[S, C] = asGetter composeGetter other\n+  final def composeSetter[C, D](other: Setter[A, B, C, D]): Setter[S, T, C, D] = asSetter composeSetter other\n+  final def composeTraversal[C, D](other: Traversal[A, B, C, D]): Traversal[S, T, C, D] = asTraversal composeTraversal other\n+  final def composeOptional[C, D](other: Optional[A, B, C, D]): Optional[S, T, C, D] = asOptional composeOptional other\n+  final def composePrism[C, D](other: Prism[A, B, C, D]): Prism[S, T, C, D] = asPrism composePrism other\n+  final def composeLens[C, D](other: Lens[A, B, C, D]): Lens[S, T, C, D] = asLens composeLens other\n   final def composeIso[C, D](other: Iso[A, B, C, D]): Iso[S, T, C, D] = new Iso[S, T, C, D]{\n     def _iso[P[_, _] : Profunctor, F[_] : Functor](pcfd: P[C, F[D]]): P[S, F[T]] =\n       (self._iso[P, F] _ compose other._iso[P, F])(pcfd)\n   }\n \n   @deprecated(\"Use composeIso\", since = \"0.5\")\n-  def compose[C, D](other: Iso[A, B, C, D]): Iso[S, T, C, D] = composeIso(other)\n+  final def compose[C, D](other: Iso[A, B, C, D]): Iso[S, T, C, D] = composeIso(other)","path":"core/src/main/scala/monocle/Iso.scala","position":54,"original_position":54,"commit_id":"6c8afbb8edfcda11c2d1cc3a31d0c9cb75724534","original_commit_id":"6c8afbb8edfcda11c2d1cc3a31d0c9cb75724534","user":{"login":"NightRa","id":2140983,"avatar_url":"https://avatars.githubusercontent.com/u/2140983?v=2","gravatar_id":"3bbfae902e1399d8ff4ad1c4a8d7b0d2","url":"https://api.github.com/users/NightRa","html_url":"https://github.com/NightRa","followers_url":"https://api.github.com/users/NightRa/followers","following_url":"https://api.github.com/users/NightRa/following{/other_user}","gists_url":"https://api.github.com/users/NightRa/gists{/gist_id}","starred_url":"https://api.github.com/users/NightRa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NightRa/subscriptions","organizations_url":"https://api.github.com/users/NightRa/orgs","repos_url":"https://api.github.com/users/NightRa/repos","events_url":"https://api.github.com/users/NightRa/events{/privacy}","received_events_url":"https://api.github.com/users/NightRa/received_events","type":"User","site_admin":false},"body":"The deprecated compose should be removed as in the rest of the commit.","created_at":"2014-08-26T09:36:28Z","updated_at":"2014-08-26T09:36:28Z","html_url":"https://github.com/julien-truffaut/Monocle/pull/126#discussion_r16704155","pull_request_url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126","_links":{"self":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/comments/16704155"},"html":{"href":"https://github.com/julien-truffaut/Monocle/pull/126#discussion_r16704155"},"pull_request":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126"}}},"pull_request":{"url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126","id":20274956,"html_url":"https://github.com/julien-truffaut/Monocle/pull/126","diff_url":"https://github.com/julien-truffaut/Monocle/pull/126.diff","patch_url":"https://github.com/julien-truffaut/Monocle/pull/126.patch","issue_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues/126","number":126,"state":"open","locked":false,"title":"#115 Remove inheritance between Optics","user":{"login":"julien-truffaut","id":1859417,"avatar_url":"https://avatars.githubusercontent.com/u/1859417?v=2","gravatar_id":"1d3a514afe5f1074ca145ec82eedf8fd","url":"https://api.github.com/users/julien-truffaut","html_url":"https://github.com/julien-truffaut","followers_url":"https://api.github.com/users/julien-truffaut/followers","following_url":"https://api.github.com/users/julien-truffaut/following{/other_user}","gists_url":"https://api.github.com/users/julien-truffaut/gists{/gist_id}","starred_url":"https://api.github.com/users/julien-truffaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julien-truffaut/subscriptions","organizations_url":"https://api.github.com/users/julien-truffaut/orgs","repos_url":"https://api.github.com/users/julien-truffaut/repos","events_url":"https://api.github.com/users/julien-truffaut/events{/privacy}","received_events_url":"https://api.github.com/users/julien-truffaut/received_events","type":"User","site_admin":false},"body":"This change is not ready yet, all the syntax (symbolic operators) part needs to be refactored.","created_at":"2014-08-25T21:50:50Z","updated_at":"2014-08-26T09:36:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00dd2e9052a6ea292b6024d2b306fca08e567f94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126/commits","review_comments_url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126/comments","review_comment_url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/comments/{number}","comments_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues/126/comments","statuses_url":"https://api.github.com/repos/julien-truffaut/Monocle/statuses/6c8afbb8edfcda11c2d1cc3a31d0c9cb75724534","head":{"label":"julien-truffaut:no-inheritance","ref":"no-inheritance","sha":"6c8afbb8edfcda11c2d1cc3a31d0c9cb75724534","user":{"login":"julien-truffaut","id":1859417,"avatar_url":"https://avatars.githubusercontent.com/u/1859417?v=2","gravatar_id":"1d3a514afe5f1074ca145ec82eedf8fd","url":"https://api.github.com/users/julien-truffaut","html_url":"https://github.com/julien-truffaut","followers_url":"https://api.github.com/users/julien-truffaut/followers","following_url":"https://api.github.com/users/julien-truffaut/following{/other_user}","gists_url":"https://api.github.com/users/julien-truffaut/gists{/gist_id}","starred_url":"https://api.github.com/users/julien-truffaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julien-truffaut/subscriptions","organizations_url":"https://api.github.com/users/julien-truffaut/orgs","repos_url":"https://api.github.com/users/julien-truffaut/repos","events_url":"https://api.github.com/users/julien-truffaut/events{/privacy}","received_events_url":"https://api.github.com/users/julien-truffaut/received_events","type":"User","site_admin":false},"repo":{"id":16009986,"name":"Monocle","full_name":"julien-truffaut/Monocle","owner":{"login":"julien-truffaut","id":1859417,"avatar_url":"https://avatars.githubusercontent.com/u/1859417?v=2","gravatar_id":"1d3a514afe5f1074ca145ec82eedf8fd","url":"https://api.github.com/users/julien-truffaut","html_url":"https://github.com/julien-truffaut","followers_url":"https://api.github.com/users/julien-truffaut/followers","following_url":"https://api.github.com/users/julien-truffaut/following{/other_user}","gists_url":"https://api.github.com/users/julien-truffaut/gists{/gist_id}","starred_url":"https://api.github.com/users/julien-truffaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julien-truffaut/subscriptions","organizations_url":"https://api.github.com/users/julien-truffaut/orgs","repos_url":"https://api.github.com/users/julien-truffaut/repos","events_url":"https://api.github.com/users/julien-truffaut/events{/privacy}","received_events_url":"https://api.github.com/users/julien-truffaut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/julien-truffaut/Monocle","description":"Lens library in Scala","fork":false,"url":"https://api.github.com/repos/julien-truffaut/Monocle","forks_url":"https://api.github.com/repos/julien-truffaut/Monocle/forks","keys_url":"https://api.github.com/repos/julien-truffaut/Monocle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/julien-truffaut/Monocle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/julien-truffaut/Monocle/teams","hooks_url":"https://api.github.com/repos/julien-truffaut/Monocle/hooks","issue_events_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues/events{/number}","events_url":"https://api.github.com/repos/julien-truffaut/Monocle/events","assignees_url":"https://api.github.com/repos/julien-truffaut/Monocle/assignees{/user}","branches_url":"https://api.github.com/repos/julien-truffaut/Monocle/branches{/branch}","tags_url":"https://api.github.com/repos/julien-truffaut/Monocle/tags","blobs_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/refs{/sha}","trees_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/julien-truffaut/Monocle/statuses/{sha}","languages_url":"https://api.github.com/repos/julien-truffaut/Monocle/languages","stargazers_url":"https://api.github.com/repos/julien-truffaut/Monocle/stargazers","contributors_url":"https://api.github.com/repos/julien-truffaut/Monocle/contributors","subscribers_url":"https://api.github.com/repos/julien-truffaut/Monocle/subscribers","subscription_url":"https://api.github.com/repos/julien-truffaut/Monocle/subscription","commits_url":"https://api.github.com/repos/julien-truffaut/Monocle/commits{/sha}","git_commits_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/commits{/sha}","comments_url":"https://api.github.com/repos/julien-truffaut/Monocle/comments{/number}","issue_comment_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues/comments/{number}","contents_url":"https://api.github.com/repos/julien-truffaut/Monocle/contents/{+path}","compare_url":"https://api.github.com/repos/julien-truffaut/Monocle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/julien-truffaut/Monocle/merges","archive_url":"https://api.github.com/repos/julien-truffaut/Monocle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/julien-truffaut/Monocle/downloads","issues_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues{/number}","pulls_url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls{/number}","milestones_url":"https://api.github.com/repos/julien-truffaut/Monocle/milestones{/number}","notifications_url":"https://api.github.com/repos/julien-truffaut/Monocle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/julien-truffaut/Monocle/labels{/name}","releases_url":"https://api.github.com/repos/julien-truffaut/Monocle/releases{/id}","created_at":"2014-01-17T19:49:22Z","updated_at":"2014-08-25T04:14:09Z","pushed_at":"2014-08-25T21:49:38Z","git_url":"git://github.com/julien-truffaut/Monocle.git","ssh_url":"git@github.com:julien-truffaut/Monocle.git","clone_url":"https://github.com/julien-truffaut/Monocle.git","svn_url":"https://github.com/julien-truffaut/Monocle","homepage":"","size":4204,"stargazers_count":144,"watchers_count":144,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":21,"mirror_url":null,"open_issues_count":17,"forks":21,"open_issues":17,"watchers":144,"default_branch":"master"}},"base":{"label":"julien-truffaut:master","ref":"master","sha":"25abd95c55eac135cf457e54c2aa25d29689ffbc","user":{"login":"julien-truffaut","id":1859417,"avatar_url":"https://avatars.githubusercontent.com/u/1859417?v=2","gravatar_id":"1d3a514afe5f1074ca145ec82eedf8fd","url":"https://api.github.com/users/julien-truffaut","html_url":"https://github.com/julien-truffaut","followers_url":"https://api.github.com/users/julien-truffaut/followers","following_url":"https://api.github.com/users/julien-truffaut/following{/other_user}","gists_url":"https://api.github.com/users/julien-truffaut/gists{/gist_id}","starred_url":"https://api.github.com/users/julien-truffaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julien-truffaut/subscriptions","organizations_url":"https://api.github.com/users/julien-truffaut/orgs","repos_url":"https://api.github.com/users/julien-truffaut/repos","events_url":"https://api.github.com/users/julien-truffaut/events{/privacy}","received_events_url":"https://api.github.com/users/julien-truffaut/received_events","type":"User","site_admin":false},"repo":{"id":16009986,"name":"Monocle","full_name":"julien-truffaut/Monocle","owner":{"login":"julien-truffaut","id":1859417,"avatar_url":"https://avatars.githubusercontent.com/u/1859417?v=2","gravatar_id":"1d3a514afe5f1074ca145ec82eedf8fd","url":"https://api.github.com/users/julien-truffaut","html_url":"https://github.com/julien-truffaut","followers_url":"https://api.github.com/users/julien-truffaut/followers","following_url":"https://api.github.com/users/julien-truffaut/following{/other_user}","gists_url":"https://api.github.com/users/julien-truffaut/gists{/gist_id}","starred_url":"https://api.github.com/users/julien-truffaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julien-truffaut/subscriptions","organizations_url":"https://api.github.com/users/julien-truffaut/orgs","repos_url":"https://api.github.com/users/julien-truffaut/repos","events_url":"https://api.github.com/users/julien-truffaut/events{/privacy}","received_events_url":"https://api.github.com/users/julien-truffaut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/julien-truffaut/Monocle","description":"Lens library in Scala","fork":false,"url":"https://api.github.com/repos/julien-truffaut/Monocle","forks_url":"https://api.github.com/repos/julien-truffaut/Monocle/forks","keys_url":"https://api.github.com/repos/julien-truffaut/Monocle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/julien-truffaut/Monocle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/julien-truffaut/Monocle/teams","hooks_url":"https://api.github.com/repos/julien-truffaut/Monocle/hooks","issue_events_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues/events{/number}","events_url":"https://api.github.com/repos/julien-truffaut/Monocle/events","assignees_url":"https://api.github.com/repos/julien-truffaut/Monocle/assignees{/user}","branches_url":"https://api.github.com/repos/julien-truffaut/Monocle/branches{/branch}","tags_url":"https://api.github.com/repos/julien-truffaut/Monocle/tags","blobs_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/refs{/sha}","trees_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/julien-truffaut/Monocle/statuses/{sha}","languages_url":"https://api.github.com/repos/julien-truffaut/Monocle/languages","stargazers_url":"https://api.github.com/repos/julien-truffaut/Monocle/stargazers","contributors_url":"https://api.github.com/repos/julien-truffaut/Monocle/contributors","subscribers_url":"https://api.github.com/repos/julien-truffaut/Monocle/subscribers","subscription_url":"https://api.github.com/repos/julien-truffaut/Monocle/subscription","commits_url":"https://api.github.com/repos/julien-truffaut/Monocle/commits{/sha}","git_commits_url":"https://api.github.com/repos/julien-truffaut/Monocle/git/commits{/sha}","comments_url":"https://api.github.com/repos/julien-truffaut/Monocle/comments{/number}","issue_comment_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues/comments/{number}","contents_url":"https://api.github.com/repos/julien-truffaut/Monocle/contents/{+path}","compare_url":"https://api.github.com/repos/julien-truffaut/Monocle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/julien-truffaut/Monocle/merges","archive_url":"https://api.github.com/repos/julien-truffaut/Monocle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/julien-truffaut/Monocle/downloads","issues_url":"https://api.github.com/repos/julien-truffaut/Monocle/issues{/number}","pulls_url":"https://api.github.com/repos/julien-truffaut/Monocle/pulls{/number}","milestones_url":"https://api.github.com/repos/julien-truffaut/Monocle/milestones{/number}","notifications_url":"https://api.github.com/repos/julien-truffaut/Monocle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/julien-truffaut/Monocle/labels{/name}","releases_url":"https://api.github.com/repos/julien-truffaut/Monocle/releases{/id}","created_at":"2014-01-17T19:49:22Z","updated_at":"2014-08-25T04:14:09Z","pushed_at":"2014-08-25T21:49:38Z","git_url":"git://github.com/julien-truffaut/Monocle.git","ssh_url":"git@github.com:julien-truffaut/Monocle.git","clone_url":"https://github.com/julien-truffaut/Monocle.git","svn_url":"https://github.com/julien-truffaut/Monocle","homepage":"","size":4204,"stargazers_count":144,"watchers_count":144,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":21,"mirror_url":null,"open_issues_count":17,"forks":21,"open_issues":17,"watchers":144,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126"},"html":{"href":"https://github.com/julien-truffaut/Monocle/pull/126"},"issue":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/issues/126"},"comments":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/issues/126/comments"},"review_comments":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126/comments"},"review_comment":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/pulls/126/commits"},"statuses":{"href":"https://api.github.com/repos/julien-truffaut/Monocle/statuses/6c8afbb8edfcda11c2d1cc3a31d0c9cb75724534"}}}}