{"action":"closed","number":1290,"pull_request":{"url":"https://api.github.com/repos/commercialhaskell/stack/pulls/1290","id":49830784,"html_url":"https://github.com/commercialhaskell/stack/pull/1290","diff_url":"https://github.com/commercialhaskell/stack/pull/1290.diff","patch_url":"https://github.com/commercialhaskell/stack/pull/1290.patch","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1290","number":1290,"state":"closed","locked":false,"title":"Typo recommendations","user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"body":"This implements thing described in #158. I've chosen to stay conservative with threshold 1. Limiting number of matches can be confusing because desired package name can be eliminated from list of suggestions. With current implementation number of matches won't ever be too big to limit it.\r\n\r\nHere is example of how it works:\r\n\r\n```\r\n[mark@arch ~]$ stack build stackage-metdata-0.3.0.0\r\nRun from outside a project, using implicit global project config\r\nUsing resolver: lts-3.9 from implicit global project's config file: /home/mark/.stack/global-project/stack.yaml\r\nDidn't see stackage-metdata-0.3.0.0 in your package indices.\r\nPerhaps you meant \"stackage-metadata\"?\r\nUpdating and trying again.\r\nUpdating package index Hackage (mirrored at https://github.com/commercialhaskell                                                                                Fetched package index.\r\nPopulated index cache.\r\nThe following package identifiers were not found in your indices: stackage-metdata-0.3.0.0\r\n[mark@arch ~]$ stack build parses-3.1.9\r\nRun from outside a project, using implicit global project config\r\nUsing resolver: lts-3.9 from implicit global project's config file: /home/mark/.stack/global-project/stack.yaml\r\nDidn't see parses-3.1.9 in your package indices.\r\nPerhaps you meant \"parsec\", \"parsek\", or \"parsers\"?\r\nUpdating and trying again.\r\nUpdating package index Hackage (mirrored at https://github.com/commercialhaskell                                                                                Fetched package index.\r\nPopulated index cache.\r\nThe following package identifiers were not found in your indices: parses-3.1.9\r\n[mark@arch ~]$\r\n```\r\n\r\nI also tested various edge cases and it behaves normally.\r\n\r\nThe refactoring should make some parts of code easier to read. I've also added comments describing what some functions do.\r\n","created_at":"2015-11-05T14:34:02Z","updated_at":"2015-11-06T03:09:42Z","closed_at":"2015-11-06T03:09:41Z","merged_at":"2015-11-06T03:09:41Z","merge_commit_sha":"cbb4c11197b207e4288ecdf5020667f06dbb63a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/1290/commits","review_comments_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/1290/comments","review_comment_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1290/comments","statuses_url":"https://api.github.com/repos/commercialhaskell/stack/statuses/cb1bb4464c9c26f0a1513828f847fddc73e59d46","head":{"label":"mrkkrp:mrkkrp-typo-recommendations","ref":"mrkkrp-typo-recommendations","sha":"cb1bb4464c9c26f0a1513828f847fddc73e59d46","user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"repo":{"id":45349689,"name":"stack","full_name":"mrkkrp/stack","owner":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrkkrp/stack","description":"The Haskell Tool Stack","fork":true,"url":"https://api.github.com/repos/mrkkrp/stack","forks_url":"https://api.github.com/repos/mrkkrp/stack/forks","keys_url":"https://api.github.com/repos/mrkkrp/stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrkkrp/stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrkkrp/stack/teams","hooks_url":"https://api.github.com/repos/mrkkrp/stack/hooks","issue_events_url":"https://api.github.com/repos/mrkkrp/stack/issues/events{/number}","events_url":"https://api.github.com/repos/mrkkrp/stack/events","assignees_url":"https://api.github.com/repos/mrkkrp/stack/assignees{/user}","branches_url":"https://api.github.com/repos/mrkkrp/stack/branches{/branch}","tags_url":"https://api.github.com/repos/mrkkrp/stack/tags","blobs_url":"https://api.github.com/repos/mrkkrp/stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrkkrp/stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrkkrp/stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrkkrp/stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrkkrp/stack/statuses/{sha}","languages_url":"https://api.github.com/repos/mrkkrp/stack/languages","stargazers_url":"https://api.github.com/repos/mrkkrp/stack/stargazers","contributors_url":"https://api.github.com/repos/mrkkrp/stack/contributors","subscribers_url":"https://api.github.com/repos/mrkkrp/stack/subscribers","subscription_url":"https://api.github.com/repos/mrkkrp/stack/subscription","commits_url":"https://api.github.com/repos/mrkkrp/stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrkkrp/stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrkkrp/stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrkkrp/stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrkkrp/stack/contents/{+path}","compare_url":"https://api.github.com/repos/mrkkrp/stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrkkrp/stack/merges","archive_url":"https://api.github.com/repos/mrkkrp/stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrkkrp/stack/downloads","issues_url":"https://api.github.com/repos/mrkkrp/stack/issues{/number}","pulls_url":"https://api.github.com/repos/mrkkrp/stack/pulls{/number}","milestones_url":"https://api.github.com/repos/mrkkrp/stack/milestones{/number}","notifications_url":"https://api.github.com/repos/mrkkrp/stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrkkrp/stack/labels{/name}","releases_url":"https://api.github.com/repos/mrkkrp/stack/releases{/id}","created_at":"2015-11-01T17:17:30Z","updated_at":"2015-11-01T17:17:32Z","pushed_at":"2015-11-05T14:57:37Z","git_url":"git://github.com/mrkkrp/stack.git","ssh_url":"git@github.com:mrkkrp/stack.git","clone_url":"https://github.com/mrkkrp/stack.git","svn_url":"https://github.com/mrkkrp/stack","homepage":"https://www.stackage.org/","size":4598,"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":"commercialhaskell:master","ref":"master","sha":"29f082ad4f51dd87c254687345ff6c1e5ea82bcb","user":{"login":"commercialhaskell","id":10633049,"avatar_url":"https://avatars.githubusercontent.com/u/10633049?v=3","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"repo":{"id":34817922,"name":"stack","full_name":"commercialhaskell/stack","owner":{"login":"commercialhaskell","id":10633049,"avatar_url":"https://avatars.githubusercontent.com/u/10633049?v=3","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/commercialhaskell/stack","description":"The Haskell Tool Stack","fork":false,"url":"https://api.github.com/repos/commercialhaskell/stack","forks_url":"https://api.github.com/repos/commercialhaskell/stack/forks","keys_url":"https://api.github.com/repos/commercialhaskell/stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercialhaskell/stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercialhaskell/stack/teams","hooks_url":"https://api.github.com/repos/commercialhaskell/stack/hooks","issue_events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/events{/number}","events_url":"https://api.github.com/repos/commercialhaskell/stack/events","assignees_url":"https://api.github.com/repos/commercialhaskell/stack/assignees{/user}","branches_url":"https://api.github.com/repos/commercialhaskell/stack/branches{/branch}","tags_url":"https://api.github.com/repos/commercialhaskell/stack/tags","blobs_url":"https://api.github.com/repos/commercialhaskell/stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercialhaskell/stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercialhaskell/stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercialhaskell/stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercialhaskell/stack/statuses/{sha}","languages_url":"https://api.github.com/repos/commercialhaskell/stack/languages","stargazers_url":"https://api.github.com/repos/commercialhaskell/stack/stargazers","contributors_url":"https://api.github.com/repos/commercialhaskell/stack/contributors","subscribers_url":"https://api.github.com/repos/commercialhaskell/stack/subscribers","subscription_url":"https://api.github.com/repos/commercialhaskell/stack/subscription","commits_url":"https://api.github.com/repos/commercialhaskell/stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercialhaskell/stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercialhaskell/stack/contents/{+path}","compare_url":"https://api.github.com/repos/commercialhaskell/stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercialhaskell/stack/merges","archive_url":"https://api.github.com/repos/commercialhaskell/stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercialhaskell/stack/downloads","issues_url":"https://api.github.com/repos/commercialhaskell/stack/issues{/number}","pulls_url":"https://api.github.com/repos/commercialhaskell/stack/pulls{/number}","milestones_url":"https://api.github.com/repos/commercialhaskell/stack/milestones{/number}","notifications_url":"https://api.github.com/repos/commercialhaskell/stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercialhaskell/stack/labels{/name}","releases_url":"https://api.github.com/repos/commercialhaskell/stack/releases{/id}","created_at":"2015-04-29T20:56:42Z","updated_at":"2015-11-06T00:29:10Z","pushed_at":"2015-11-06T03:09:41Z","git_url":"git://github.com/commercialhaskell/stack.git","ssh_url":"git@github.com:commercialhaskell/stack.git","clone_url":"https://github.com/commercialhaskell/stack.git","svn_url":"https://github.com/commercialhaskell/stack","homepage":"https://www.stackage.org/","size":10017,"stargazers_count":1154,"watchers_count":1154,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":131,"mirror_url":null,"open_issues_count":128,"forks":131,"open_issues":128,"watchers":1154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/1290"},"html":{"href":"https://github.com/commercialhaskell/stack/pull/1290"},"issue":{"href":"https://api.github.com/repos/commercialhaskell/stack/issues/1290"},"comments":{"href":"https://api.github.com/repos/commercialhaskell/stack/issues/1290/comments"},"review_comments":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/1290/comments"},"review_comment":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/1290/commits"},"statuses":{"href":"https://api.github.com/repos/commercialhaskell/stack/statuses/cb1bb4464c9c26f0a1513828f847fddc73e59d46"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":84,"deletions":62,"changed_files":3}}