{"action":"created","issue":{"url":"https://api.github.com/repos/non/algebra/issues/148","repository_url":"https://api.github.com/repos/non/algebra","labels_url":"https://api.github.com/repos/non/algebra/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/non/algebra/issues/148/comments","events_url":"https://api.github.com/repos/non/algebra/issues/148/events","html_url":"https://github.com/non/algebra/issues/148","id":150094940,"number":148,"title":"\"Vector\" instances are questionable","user":{"login":"johnynek","id":67958,"avatar_url":"https://avatars.githubusercontent.com/u/67958?v=3","gravatar_id":"","url":"https://api.github.com/users/johnynek","html_url":"https://github.com/johnynek","followers_url":"https://api.github.com/users/johnynek/followers","following_url":"https://api.github.com/users/johnynek/following{/other_user}","gists_url":"https://api.github.com/users/johnynek/gists{/gist_id}","starred_url":"https://api.github.com/users/johnynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnynek/subscriptions","organizations_url":"https://api.github.com/users/johnynek/orgs","repos_url":"https://api.github.com/users/johnynek/repos","events_url":"https://api.github.com/users/johnynek/events{/privacy}","received_events_url":"https://api.github.com/users/johnynek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2016-04-21T14:42:17Z","updated_at":"2016-04-30T07:00:06Z","closed_at":null,"body":"@non @tixxit and I were talking about `mapVectorEq` and for instance the `Group` on `Map[K, V]` that assumes that a missing key is the same as `Group.empty`.\r\n\r\nThis has some issues. Without the correct `Eq[Map[K, V]]` in scope, you violate the laws. Moreover, the standard `Eq` should not be one that has this behavior, because that does not make sense for a lot of use cases.\r\n\r\nOur solution is to wrap such instances:\r\n```scala\r\n// infinite map defined at all keys K\r\ntrait SparseMap[K, V] {\r\n  def get(k: K): V\r\n  def updated(k: K, v: V): SparseMap[K, V]\r\n  def toMap: Map[K, V]\r\n}\r\n\r\n// an infinite vector that is defined at all points (i: Int)\r\ntrait SparseVector[T] {\r\n  def apply(i: Int): T\r\n  def updated(i: Int, v: T): SparseVector[T]\r\n  def toVector: Vector[T]\r\n}\r\n```\r\nIn this way #126 would be an instance on `SparseMap`"},"comment":{"url":"https://api.github.com/repos/non/algebra/issues/comments/215942918","html_url":"https://github.com/non/algebra/issues/148#issuecomment-215942918","issue_url":"https://api.github.com/repos/non/algebra/issues/148","id":215942918,"user":{"login":"TomasMikula","id":433439,"avatar_url":"https://avatars.githubusercontent.com/u/433439?v=3","gravatar_id":"","url":"https://api.github.com/users/TomasMikula","html_url":"https://github.com/TomasMikula","followers_url":"https://api.github.com/users/TomasMikula/followers","following_url":"https://api.github.com/users/TomasMikula/following{/other_user}","gists_url":"https://api.github.com/users/TomasMikula/gists{/gist_id}","starred_url":"https://api.github.com/users/TomasMikula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomasMikula/subscriptions","organizations_url":"https://api.github.com/users/TomasMikula/orgs","repos_url":"https://api.github.com/users/TomasMikula/repos","events_url":"https://api.github.com/users/TomasMikula/events{/privacy}","received_events_url":"https://api.github.com/users/TomasMikula/received_events","type":"User","site_admin":false},"created_at":"2016-04-30T07:00:06Z","updated_at":"2016-04-30T07:00:06Z","body":"> No, the result will be whatever the operation is applied to the default values.\r\n\r\nIn your library, yes. My comment was about @johnynek's code posted above."}}