{"action":"created","comment":{"url":"https://api.github.com/repos/ambiata/disorder.hs/pulls/comments/53879545","id":53879545,"diff_hunk":"@@ -35,6 +39,13 @@ maybeGen g = sized $ \\s ->\n     (1, return Nothing),\n     (s, Just <$> resize (s `div` 2) g)]\n \n+-- | Wait for a generated `Just` value\n+--\n+-- Use _only_ in case of emergencies when you have no other way to get an `a` safely\n+genFromMaybe :: Gen (Maybe a) -> Gen a","path":"disorder-core/src/Disorder/Core/Gen.hs","position":24,"original_position":25,"commit_id":"6e0a56a567a586d44d0bcecfb2cdfe04b8c19fc2","original_commit_id":"2d5a95ed242d5c7f8698bb932cb7c8f05b635bc9","user":{"login":"EduardSergeev","id":722409,"avatar_url":"https://avatars.githubusercontent.com/u/722409?v=3","gravatar_id":"","url":"https://api.github.com/users/EduardSergeev","html_url":"https://github.com/EduardSergeev","followers_url":"https://api.github.com/users/EduardSergeev/followers","following_url":"https://api.github.com/users/EduardSergeev/following{/other_user}","gists_url":"https://api.github.com/users/EduardSergeev/gists{/gist_id}","starred_url":"https://api.github.com/users/EduardSergeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EduardSergeev/subscriptions","organizations_url":"https://api.github.com/users/EduardSergeev/orgs","repos_url":"https://api.github.com/users/EduardSergeev/repos","events_url":"https://api.github.com/users/EduardSergeev/events{/privacy}","received_events_url":"https://api.github.com/users/EduardSergeev/received_events","type":"User","site_admin":false},"body":"@domdere Doesn't compile, was it your version of [suchThat](http://hackage.haskell.org/package/QuickCheck-2.8.2/docs/src/Test-QuickCheck-Gen.html#suchThat)?\r\nAnyway, personally I wouldn't add this combinator to disorder: if the original `Gen (Maybe a)` generates `Just`'s only just do `fromJust <$>` but if \"Nothing\" is possible, the generator could always fail depending on the `size` so the test becomes unreliable. The best option I guess is to lift entire test code into `Maybe` and check it at the end of the test. ","created_at":"2016-02-24T01:06:16Z","updated_at":"2016-02-24T01:06:16Z","html_url":"https://github.com/ambiata/disorder.hs/pull/65#discussion_r53879545","pull_request_url":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/ambiata/disorder.hs/pulls/comments/53879545"},"html":{"href":"https://github.com/ambiata/disorder.hs/pull/65#discussion_r53879545"},"pull_request":{"href":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65","id":60412188,"html_url":"https://github.com/ambiata/disorder.hs/pull/65","diff_url":"https://github.com/ambiata/disorder.hs/pull/65.diff","patch_url":"https://github.com/ambiata/disorder.hs/pull/65.patch","issue_url":"https://api.github.com/repos/ambiata/disorder.hs/issues/65","number":65,"state":"closed","locked":false,"title":"Introduce genFromMaybe","user":{"login":"charleso","id":31059,"avatar_url":"https://avatars.githubusercontent.com/u/31059?v=3","gravatar_id":"","url":"https://api.github.com/users/charleso","html_url":"https://github.com/charleso","followers_url":"https://api.github.com/users/charleso/followers","following_url":"https://api.github.com/users/charleso/following{/other_user}","gists_url":"https://api.github.com/users/charleso/gists{/gist_id}","starred_url":"https://api.github.com/users/charleso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charleso/subscriptions","organizations_url":"https://api.github.com/users/charleso/orgs","repos_url":"https://api.github.com/users/charleso/repos","events_url":"https://api.github.com/users/charleso/events{/privacy}","received_events_url":"https://api.github.com/users/charleso/received_events","type":"User","site_admin":false},"body":"/cc @jystic Noticed you added this in [blizzard](https://github.com/ambiata/blizzard/pull/3/files#diff-840238f0438c63bcf77e44fa0b3db2f4R165) and I have one too in [napoleon](https://github.com/ambiata/napoleon/blob/787b054aaf7c3704bd67fd3799920a55abc0a95b/napoleon-core/test/Test/Napoleon/Gen/DictionaryDiff.hs#L115)\r\n\r\nNaming suggestions welcome","created_at":"2016-02-23T21:24:15Z","updated_at":"2016-02-24T01:06:16Z","closed_at":"2016-02-23T22:57:01Z","merged_at":"2016-02-23T22:57:01Z","merge_commit_sha":"e5578613a7b5664355013eabec60b2332d93a5cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65/commits","review_comments_url":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65/comments","review_comment_url":"https://api.github.com/repos/ambiata/disorder.hs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ambiata/disorder.hs/issues/65/comments","statuses_url":"https://api.github.com/repos/ambiata/disorder.hs/statuses/6e0a56a567a586d44d0bcecfb2cdfe04b8c19fc2","head":{"label":"ambiata:topic/gen-from-maybe","ref":"topic/gen-from-maybe","sha":"6e0a56a567a586d44d0bcecfb2cdfe04b8c19fc2","user":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"repo":{"id":31634194,"name":"disorder.hs","full_name":"ambiata/disorder.hs","owner":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ambiata/disorder.hs","description":"QuickCheck extras.","fork":false,"url":"https://api.github.com/repos/ambiata/disorder.hs","forks_url":"https://api.github.com/repos/ambiata/disorder.hs/forks","keys_url":"https://api.github.com/repos/ambiata/disorder.hs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ambiata/disorder.hs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ambiata/disorder.hs/teams","hooks_url":"https://api.github.com/repos/ambiata/disorder.hs/hooks","issue_events_url":"https://api.github.com/repos/ambiata/disorder.hs/issues/events{/number}","events_url":"https://api.github.com/repos/ambiata/disorder.hs/events","assignees_url":"https://api.github.com/repos/ambiata/disorder.hs/assignees{/user}","branches_url":"https://api.github.com/repos/ambiata/disorder.hs/branches{/branch}","tags_url":"https://api.github.com/repos/ambiata/disorder.hs/tags","blobs_url":"https://api.github.com/repos/ambiata/disorder.hs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ambiata/disorder.hs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ambiata/disorder.hs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ambiata/disorder.hs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ambiata/disorder.hs/statuses/{sha}","languages_url":"https://api.github.com/repos/ambiata/disorder.hs/languages","stargazers_url":"https://api.github.com/repos/ambiata/disorder.hs/stargazers","contributors_url":"https://api.github.com/repos/ambiata/disorder.hs/contributors","subscribers_url":"https://api.github.com/repos/ambiata/disorder.hs/subscribers","subscription_url":"https://api.github.com/repos/ambiata/disorder.hs/subscription","commits_url":"https://api.github.com/repos/ambiata/disorder.hs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ambiata/disorder.hs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ambiata/disorder.hs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ambiata/disorder.hs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ambiata/disorder.hs/contents/{+path}","compare_url":"https://api.github.com/repos/ambiata/disorder.hs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ambiata/disorder.hs/merges","archive_url":"https://api.github.com/repos/ambiata/disorder.hs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ambiata/disorder.hs/downloads","issues_url":"https://api.github.com/repos/ambiata/disorder.hs/issues{/number}","pulls_url":"https://api.github.com/repos/ambiata/disorder.hs/pulls{/number}","milestones_url":"https://api.github.com/repos/ambiata/disorder.hs/milestones{/number}","notifications_url":"https://api.github.com/repos/ambiata/disorder.hs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ambiata/disorder.hs/labels{/name}","releases_url":"https://api.github.com/repos/ambiata/disorder.hs/releases{/id}","deployments_url":"https://api.github.com/repos/ambiata/disorder.hs/deployments","created_at":"2015-03-04T02:41:32Z","updated_at":"2016-01-19T08:03:52Z","pushed_at":"2016-02-23T22:57:02Z","git_url":"git://github.com/ambiata/disorder.hs.git","ssh_url":"git@github.com:ambiata/disorder.hs.git","clone_url":"https://github.com/ambiata/disorder.hs.git","svn_url":"https://github.com/ambiata/disorder.hs","homepage":null,"size":180,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"ambiata:master","ref":"master","sha":"f10287ef27baaa173059acf4237a6cc34b280e72","user":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"repo":{"id":31634194,"name":"disorder.hs","full_name":"ambiata/disorder.hs","owner":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ambiata/disorder.hs","description":"QuickCheck extras.","fork":false,"url":"https://api.github.com/repos/ambiata/disorder.hs","forks_url":"https://api.github.com/repos/ambiata/disorder.hs/forks","keys_url":"https://api.github.com/repos/ambiata/disorder.hs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ambiata/disorder.hs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ambiata/disorder.hs/teams","hooks_url":"https://api.github.com/repos/ambiata/disorder.hs/hooks","issue_events_url":"https://api.github.com/repos/ambiata/disorder.hs/issues/events{/number}","events_url":"https://api.github.com/repos/ambiata/disorder.hs/events","assignees_url":"https://api.github.com/repos/ambiata/disorder.hs/assignees{/user}","branches_url":"https://api.github.com/repos/ambiata/disorder.hs/branches{/branch}","tags_url":"https://api.github.com/repos/ambiata/disorder.hs/tags","blobs_url":"https://api.github.com/repos/ambiata/disorder.hs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ambiata/disorder.hs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ambiata/disorder.hs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ambiata/disorder.hs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ambiata/disorder.hs/statuses/{sha}","languages_url":"https://api.github.com/repos/ambiata/disorder.hs/languages","stargazers_url":"https://api.github.com/repos/ambiata/disorder.hs/stargazers","contributors_url":"https://api.github.com/repos/ambiata/disorder.hs/contributors","subscribers_url":"https://api.github.com/repos/ambiata/disorder.hs/subscribers","subscription_url":"https://api.github.com/repos/ambiata/disorder.hs/subscription","commits_url":"https://api.github.com/repos/ambiata/disorder.hs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ambiata/disorder.hs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ambiata/disorder.hs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ambiata/disorder.hs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ambiata/disorder.hs/contents/{+path}","compare_url":"https://api.github.com/repos/ambiata/disorder.hs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ambiata/disorder.hs/merges","archive_url":"https://api.github.com/repos/ambiata/disorder.hs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ambiata/disorder.hs/downloads","issues_url":"https://api.github.com/repos/ambiata/disorder.hs/issues{/number}","pulls_url":"https://api.github.com/repos/ambiata/disorder.hs/pulls{/number}","milestones_url":"https://api.github.com/repos/ambiata/disorder.hs/milestones{/number}","notifications_url":"https://api.github.com/repos/ambiata/disorder.hs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ambiata/disorder.hs/labels{/name}","releases_url":"https://api.github.com/repos/ambiata/disorder.hs/releases{/id}","deployments_url":"https://api.github.com/repos/ambiata/disorder.hs/deployments","created_at":"2015-03-04T02:41:32Z","updated_at":"2016-01-19T08:03:52Z","pushed_at":"2016-02-23T22:57:02Z","git_url":"git://github.com/ambiata/disorder.hs.git","ssh_url":"git@github.com:ambiata/disorder.hs.git","clone_url":"https://github.com/ambiata/disorder.hs.git","svn_url":"https://github.com/ambiata/disorder.hs","homepage":null,"size":180,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65"},"html":{"href":"https://github.com/ambiata/disorder.hs/pull/65"},"issue":{"href":"https://api.github.com/repos/ambiata/disorder.hs/issues/65"},"comments":{"href":"https://api.github.com/repos/ambiata/disorder.hs/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/ambiata/disorder.hs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ambiata/disorder.hs/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/ambiata/disorder.hs/statuses/6e0a56a567a586d44d0bcecfb2cdfe04b8c19fc2"}}}}