{"action":"opened","number":222,"pull_request":{"url":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/222","id":111208868,"html_url":"https://github.com/albertoruiz/hmatrix/pull/222","diff_url":"https://github.com/albertoruiz/hmatrix/pull/222.diff","patch_url":"https://github.com/albertoruiz/hmatrix/pull/222.patch","issue_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/222","number":222,"state":"open","locked":false,"title":"Fix bug in equal","user":{"login":"HuwCampbell","id":5205457,"avatar_url":"https://avatars3.githubusercontent.com/u/5205457?v=3","gravatar_id":"","url":"https://api.github.com/users/HuwCampbell","html_url":"https://github.com/HuwCampbell","followers_url":"https://api.github.com/users/HuwCampbell/followers","following_url":"https://api.github.com/users/HuwCampbell/following{/other_user}","gists_url":"https://api.github.com/users/HuwCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/HuwCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuwCampbell/subscriptions","organizations_url":"https://api.github.com/users/HuwCampbell/orgs","repos_url":"https://api.github.com/users/HuwCampbell/repos","events_url":"https://api.github.com/users/HuwCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/HuwCampbell/received_events","type":"User","site_admin":false},"body":"I was writing some property tests in some internal code and came across this particular gem:\r\n```\r\nλ> import Numeric.LinearAlgebra\r\nλ> let x = (0><0) [] :: Matrix Double\r\nλ> x == x\r\n*** Exception: maxElement of empty Vector\r\n```\r\n\r\nIt is actually a bug in Container Vector.\r\n```\r\n> let v =  (vector [] :: Vector Double)\r\n> v == v\r\nTrue\r\n> v `equal` v\r\n*** Exception: maxElement of empty Vector\r\n```\r\n\r\nThis PR changes equals and scalar' to straight up use Data.Vector's functions.  Hopefully these ones are just as efficient (I would expect them to be).\r\n\r\nThere are also similar bugs in norm_X functions (they throw exceptions for empty matricies) which this PR does not address\r\n\r\n```\r\n> let x = (0><0) [] :: Matrix Double\r\n> norm_0  x\r\n0.0\r\n> norm_1  x\r\n*** Exception: Prelude.maximum: empty list\r\n> norm_2  x\r\n** On entry to DGESVD, parameter number  6 had an illegal value\r\n** On entry to DGESVD, parameter number  6 had an illegal value\r\n*** Exception: svR: code -6\r\n> norm_Inf  x\r\n*** Exception: Prelude.maximum: empty list\r\n```","created_at":"2017-03-17T03:44:11Z","updated_at":"2017-03-17T03:44:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/222/commits","review_comments_url":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/222/comments","review_comment_url":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/222/comments","statuses_url":"https://api.github.com/repos/albertoruiz/hmatrix/statuses/494b910a084f4daed21055aedf315f2c12074617","head":{"label":"HuwCampbell:master","ref":"master","sha":"494b910a084f4daed21055aedf315f2c12074617","user":{"login":"HuwCampbell","id":5205457,"avatar_url":"https://avatars3.githubusercontent.com/u/5205457?v=3","gravatar_id":"","url":"https://api.github.com/users/HuwCampbell","html_url":"https://github.com/HuwCampbell","followers_url":"https://api.github.com/users/HuwCampbell/followers","following_url":"https://api.github.com/users/HuwCampbell/following{/other_user}","gists_url":"https://api.github.com/users/HuwCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/HuwCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuwCampbell/subscriptions","organizations_url":"https://api.github.com/users/HuwCampbell/orgs","repos_url":"https://api.github.com/users/HuwCampbell/repos","events_url":"https://api.github.com/users/HuwCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/HuwCampbell/received_events","type":"User","site_admin":false},"repo":{"id":85266660,"name":"hmatrix","full_name":"HuwCampbell/hmatrix","owner":{"login":"HuwCampbell","id":5205457,"avatar_url":"https://avatars3.githubusercontent.com/u/5205457?v=3","gravatar_id":"","url":"https://api.github.com/users/HuwCampbell","html_url":"https://github.com/HuwCampbell","followers_url":"https://api.github.com/users/HuwCampbell/followers","following_url":"https://api.github.com/users/HuwCampbell/following{/other_user}","gists_url":"https://api.github.com/users/HuwCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/HuwCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuwCampbell/subscriptions","organizations_url":"https://api.github.com/users/HuwCampbell/orgs","repos_url":"https://api.github.com/users/HuwCampbell/repos","events_url":"https://api.github.com/users/HuwCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/HuwCampbell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HuwCampbell/hmatrix","description":"Linear algebra and numerical computation","fork":true,"url":"https://api.github.com/repos/HuwCampbell/hmatrix","forks_url":"https://api.github.com/repos/HuwCampbell/hmatrix/forks","keys_url":"https://api.github.com/repos/HuwCampbell/hmatrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HuwCampbell/hmatrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HuwCampbell/hmatrix/teams","hooks_url":"https://api.github.com/repos/HuwCampbell/hmatrix/hooks","issue_events_url":"https://api.github.com/repos/HuwCampbell/hmatrix/issues/events{/number}","events_url":"https://api.github.com/repos/HuwCampbell/hmatrix/events","assignees_url":"https://api.github.com/repos/HuwCampbell/hmatrix/assignees{/user}","branches_url":"https://api.github.com/repos/HuwCampbell/hmatrix/branches{/branch}","tags_url":"https://api.github.com/repos/HuwCampbell/hmatrix/tags","blobs_url":"https://api.github.com/repos/HuwCampbell/hmatrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HuwCampbell/hmatrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HuwCampbell/hmatrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/HuwCampbell/hmatrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HuwCampbell/hmatrix/statuses/{sha}","languages_url":"https://api.github.com/repos/HuwCampbell/hmatrix/languages","stargazers_url":"https://api.github.com/repos/HuwCampbell/hmatrix/stargazers","contributors_url":"https://api.github.com/repos/HuwCampbell/hmatrix/contributors","subscribers_url":"https://api.github.com/repos/HuwCampbell/hmatrix/subscribers","subscription_url":"https://api.github.com/repos/HuwCampbell/hmatrix/subscription","commits_url":"https://api.github.com/repos/HuwCampbell/hmatrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/HuwCampbell/hmatrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/HuwCampbell/hmatrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/HuwCampbell/hmatrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/HuwCampbell/hmatrix/contents/{+path}","compare_url":"https://api.github.com/repos/HuwCampbell/hmatrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HuwCampbell/hmatrix/merges","archive_url":"https://api.github.com/repos/HuwCampbell/hmatrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HuwCampbell/hmatrix/downloads","issues_url":"https://api.github.com/repos/HuwCampbell/hmatrix/issues{/number}","pulls_url":"https://api.github.com/repos/HuwCampbell/hmatrix/pulls{/number}","milestones_url":"https://api.github.com/repos/HuwCampbell/hmatrix/milestones{/number}","notifications_url":"https://api.github.com/repos/HuwCampbell/hmatrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HuwCampbell/hmatrix/labels{/name}","releases_url":"https://api.github.com/repos/HuwCampbell/hmatrix/releases{/id}","deployments_url":"https://api.github.com/repos/HuwCampbell/hmatrix/deployments","created_at":"2017-03-17T03:23:19Z","updated_at":"2017-03-17T03:23:21Z","pushed_at":"2017-03-17T03:37:45Z","git_url":"git://github.com/HuwCampbell/hmatrix.git","ssh_url":"git@github.com:HuwCampbell/hmatrix.git","clone_url":"https://github.com/HuwCampbell/hmatrix.git","svn_url":"https://github.com/HuwCampbell/hmatrix","homepage":"","size":2959,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"albertoruiz:master","ref":"master","sha":"d2d0066d2ff3d8e66ce902ee1b9d1317f1710a2c","user":{"login":"albertoruiz","id":739735,"avatar_url":"https://avatars3.githubusercontent.com/u/739735?v=3","gravatar_id":"","url":"https://api.github.com/users/albertoruiz","html_url":"https://github.com/albertoruiz","followers_url":"https://api.github.com/users/albertoruiz/followers","following_url":"https://api.github.com/users/albertoruiz/following{/other_user}","gists_url":"https://api.github.com/users/albertoruiz/gists{/gist_id}","starred_url":"https://api.github.com/users/albertoruiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertoruiz/subscriptions","organizations_url":"https://api.github.com/users/albertoruiz/orgs","repos_url":"https://api.github.com/users/albertoruiz/repos","events_url":"https://api.github.com/users/albertoruiz/events{/privacy}","received_events_url":"https://api.github.com/users/albertoruiz/received_events","type":"User","site_admin":false},"repo":{"id":2935325,"name":"hmatrix","full_name":"albertoruiz/hmatrix","owner":{"login":"albertoruiz","id":739735,"avatar_url":"https://avatars3.githubusercontent.com/u/739735?v=3","gravatar_id":"","url":"https://api.github.com/users/albertoruiz","html_url":"https://github.com/albertoruiz","followers_url":"https://api.github.com/users/albertoruiz/followers","following_url":"https://api.github.com/users/albertoruiz/following{/other_user}","gists_url":"https://api.github.com/users/albertoruiz/gists{/gist_id}","starred_url":"https://api.github.com/users/albertoruiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertoruiz/subscriptions","organizations_url":"https://api.github.com/users/albertoruiz/orgs","repos_url":"https://api.github.com/users/albertoruiz/repos","events_url":"https://api.github.com/users/albertoruiz/events{/privacy}","received_events_url":"https://api.github.com/users/albertoruiz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/albertoruiz/hmatrix","description":"Linear algebra and numerical computation","fork":false,"url":"https://api.github.com/repos/albertoruiz/hmatrix","forks_url":"https://api.github.com/repos/albertoruiz/hmatrix/forks","keys_url":"https://api.github.com/repos/albertoruiz/hmatrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/albertoruiz/hmatrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/albertoruiz/hmatrix/teams","hooks_url":"https://api.github.com/repos/albertoruiz/hmatrix/hooks","issue_events_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/events{/number}","events_url":"https://api.github.com/repos/albertoruiz/hmatrix/events","assignees_url":"https://api.github.com/repos/albertoruiz/hmatrix/assignees{/user}","branches_url":"https://api.github.com/repos/albertoruiz/hmatrix/branches{/branch}","tags_url":"https://api.github.com/repos/albertoruiz/hmatrix/tags","blobs_url":"https://api.github.com/repos/albertoruiz/hmatrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/albertoruiz/hmatrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/albertoruiz/hmatrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/albertoruiz/hmatrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/albertoruiz/hmatrix/statuses/{sha}","languages_url":"https://api.github.com/repos/albertoruiz/hmatrix/languages","stargazers_url":"https://api.github.com/repos/albertoruiz/hmatrix/stargazers","contributors_url":"https://api.github.com/repos/albertoruiz/hmatrix/contributors","subscribers_url":"https://api.github.com/repos/albertoruiz/hmatrix/subscribers","subscription_url":"https://api.github.com/repos/albertoruiz/hmatrix/subscription","commits_url":"https://api.github.com/repos/albertoruiz/hmatrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/albertoruiz/hmatrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/albertoruiz/hmatrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/albertoruiz/hmatrix/contents/{+path}","compare_url":"https://api.github.com/repos/albertoruiz/hmatrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/albertoruiz/hmatrix/merges","archive_url":"https://api.github.com/repos/albertoruiz/hmatrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/albertoruiz/hmatrix/downloads","issues_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues{/number}","pulls_url":"https://api.github.com/repos/albertoruiz/hmatrix/pulls{/number}","milestones_url":"https://api.github.com/repos/albertoruiz/hmatrix/milestones{/number}","notifications_url":"https://api.github.com/repos/albertoruiz/hmatrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/albertoruiz/hmatrix/labels{/name}","releases_url":"https://api.github.com/repos/albertoruiz/hmatrix/releases{/id}","deployments_url":"https://api.github.com/repos/albertoruiz/hmatrix/deployments","created_at":"2011-12-07T20:11:51Z","updated_at":"2017-03-11T02:36:31Z","pushed_at":"2017-03-03T16:37:41Z","git_url":"git://github.com/albertoruiz/hmatrix.git","ssh_url":"git@github.com:albertoruiz/hmatrix.git","clone_url":"https://github.com/albertoruiz/hmatrix.git","svn_url":"https://github.com/albertoruiz/hmatrix","homepage":"","size":2959,"stargazers_count":241,"watchers_count":241,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":37,"forks":77,"open_issues":37,"watchers":241,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/222"},"html":{"href":"https://github.com/albertoruiz/hmatrix/pull/222"},"issue":{"href":"https://api.github.com/repos/albertoruiz/hmatrix/issues/222"},"comments":{"href":"https://api.github.com/repos/albertoruiz/hmatrix/issues/222/comments"},"review_comments":{"href":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/222/comments"},"review_comment":{"href":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/albertoruiz/hmatrix/pulls/222/commits"},"statuses":{"href":"https://api.github.com/repos/albertoruiz/hmatrix/statuses/494b910a084f4daed21055aedf315f2c12074617"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":13,"deletions":12,"changed_files":1}}
{"actor":{"display_login":"HuwCampbell"}}