{"action":"created","comment":{"url":"https://api.github.com/repos/jystic/dotnet-jack/pulls/comments/83215451","pull_request_review_id":4071983,"id":83215451,"diff_hunk":"@@ -43,6 +43,13 @@ module Property =\n         else\n             Failure [] |> ofResult\n \n+    let private convert (value : 'T) =\n+        match box value with\n+        | :? Lazy<bool> as b -> ofBool b.Value\n+        | :? Property   as p -> p\n+        | :? bool       as b -> ofBool b\n+        | _                  -> ofBool true","path":"Jack/Property.fs","position":9,"original_position":9,"commit_id":"04af38792841fdd0799c7d16314ca7ff58fe28db","original_commit_id":"04af38792841fdd0799c7d16314ca7ff58fe28db","user":{"login":"moodmosaic","id":287532,"avatar_url":"https://avatars.githubusercontent.com/u/287532?v=3","gravatar_id":"","url":"https://api.github.com/users/moodmosaic","html_url":"https://github.com/moodmosaic","followers_url":"https://api.github.com/users/moodmosaic/followers","following_url":"https://api.github.com/users/moodmosaic/following{/other_user}","gists_url":"https://api.github.com/users/moodmosaic/gists{/gist_id}","starred_url":"https://api.github.com/users/moodmosaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moodmosaic/subscriptions","organizations_url":"https://api.github.com/users/moodmosaic/orgs","repos_url":"https://api.github.com/users/moodmosaic/repos","events_url":"https://api.github.com/users/moodmosaic/events{/privacy}","received_events_url":"https://api.github.com/users/moodmosaic/received_events","type":"User","site_admin":false},"body":"Yes, it'll make things easier when it gets released 😃","created_at":"2016-10-13T13:30:55Z","updated_at":"2016-10-13T13:30:55Z","html_url":"https://github.com/jystic/dotnet-jack/pull/22#discussion_r83215451","pull_request_url":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/jystic/dotnet-jack/pulls/comments/83215451"},"html":{"href":"https://github.com/jystic/dotnet-jack/pull/22#discussion_r83215451"},"pull_request":{"href":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22","id":89172740,"html_url":"https://github.com/jystic/dotnet-jack/pull/22","diff_url":"https://github.com/jystic/dotnet-jack/pull/22.diff","patch_url":"https://github.com/jystic/dotnet-jack/pull/22.patch","issue_url":"https://api.github.com/repos/jystic/dotnet-jack/issues/22","number":22,"state":"closed","locked":false,"title":"Conditional and Lazy Properties","user":{"login":"moodmosaic","id":287532,"avatar_url":"https://avatars.githubusercontent.com/u/287532?v=3","gravatar_id":"","url":"https://api.github.com/users/moodmosaic","html_url":"https://github.com/moodmosaic","followers_url":"https://api.github.com/users/moodmosaic/followers","following_url":"https://api.github.com/users/moodmosaic/following{/other_user}","gists_url":"https://api.github.com/users/moodmosaic/gists{/gist_id}","starred_url":"https://api.github.com/users/moodmosaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moodmosaic/subscriptions","organizations_url":"https://api.github.com/users/moodmosaic/orgs","repos_url":"https://api.github.com/users/moodmosaic/repos","events_url":"https://api.github.com/users/moodmosaic/events{/privacy}","received_events_url":"https://api.github.com/users/moodmosaic/received_events","type":"User","site_admin":false},"body":"Implemented as in QuickCheck 1.2.0.1, and as described in the [manual](http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.html\r\n). The important thing here is that even though properties may take the form\r\n\r\n```\r\n<condition> ==> <property>\r\n```\r\n\r\nF# has strict semantics, and so the use of a lazy computation can be required in cases we shouldn't evaluate the property at the right of the condition.\r\n\r\nFor example, the following property isn't checked correctly without using a `lazy` computation:\r\n\r\n```f#\r\nfun n -> n <> 0 ==> (1 / n = 1 / n)\r\n|> Property.forAll Gen.int\r\n|> Property.check\r\n\r\nSystem.DivideByZeroException: Attempted to divide by zero.\r\n>    at FSI_0045.it@92-64.Invoke(Int32 n) in ..\r\nStopped due to error\r\n```\r\n\r\nInstead, we need to tell Jack to *not* evaluate the computation immediately and instead evaluate it only when the result is needed:\r\n\r\n```f#\r\nfun n -> n <> 0 ==> lazy (1 / n = 1 / n)\r\n|> Property.forAll Gen.int\r\n|> Property.check\r\n\r\n+++ OK, passed 100 tests.\r\nval it : bool = true\r\n>\r\n```","created_at":"2016-10-13T10:11:44Z","updated_at":"2016-10-13T13:30:55Z","closed_at":"2016-10-13T13:09:05Z","merged_at":null,"merge_commit_sha":"16d9bbc7f9d17cdb63f236a0f2d77db8d8fedfe9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22/commits","review_comments_url":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22/comments","review_comment_url":"https://api.github.com/repos/jystic/dotnet-jack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jystic/dotnet-jack/issues/22/comments","statuses_url":"https://api.github.com/repos/jystic/dotnet-jack/statuses/04af38792841fdd0799c7d16314ca7ff58fe28db","head":{"label":"moodmosaic:conditional-properties","ref":"conditional-properties","sha":"04af38792841fdd0799c7d16314ca7ff58fe28db","user":{"login":"moodmosaic","id":287532,"avatar_url":"https://avatars.githubusercontent.com/u/287532?v=3","gravatar_id":"","url":"https://api.github.com/users/moodmosaic","html_url":"https://github.com/moodmosaic","followers_url":"https://api.github.com/users/moodmosaic/followers","following_url":"https://api.github.com/users/moodmosaic/following{/other_user}","gists_url":"https://api.github.com/users/moodmosaic/gists{/gist_id}","starred_url":"https://api.github.com/users/moodmosaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moodmosaic/subscriptions","organizations_url":"https://api.github.com/users/moodmosaic/orgs","repos_url":"https://api.github.com/users/moodmosaic/repos","events_url":"https://api.github.com/users/moodmosaic/events{/privacy}","received_events_url":"https://api.github.com/users/moodmosaic/received_events","type":"User","site_admin":false},"repo":{"id":70313384,"name":"dotnet-jack","full_name":"moodmosaic/dotnet-jack","owner":{"login":"moodmosaic","id":287532,"avatar_url":"https://avatars.githubusercontent.com/u/287532?v=3","gravatar_id":"","url":"https://api.github.com/users/moodmosaic","html_url":"https://github.com/moodmosaic","followers_url":"https://api.github.com/users/moodmosaic/followers","following_url":"https://api.github.com/users/moodmosaic/following{/other_user}","gists_url":"https://api.github.com/users/moodmosaic/gists{/gist_id}","starred_url":"https://api.github.com/users/moodmosaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moodmosaic/subscriptions","organizations_url":"https://api.github.com/users/moodmosaic/orgs","repos_url":"https://api.github.com/users/moodmosaic/repos","events_url":"https://api.github.com/users/moodmosaic/events{/privacy}","received_events_url":"https://api.github.com/users/moodmosaic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/moodmosaic/dotnet-jack","description":"QuickCheck with shrinking for free","fork":true,"url":"https://api.github.com/repos/moodmosaic/dotnet-jack","forks_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/forks","keys_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/teams","hooks_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/hooks","issue_events_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/issues/events{/number}","events_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/events","assignees_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/assignees{/user}","branches_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/branches{/branch}","tags_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/tags","blobs_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/git/refs{/sha}","trees_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/statuses/{sha}","languages_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/languages","stargazers_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/stargazers","contributors_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/contributors","subscribers_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/subscribers","subscription_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/subscription","commits_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/commits{/sha}","git_commits_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/git/commits{/sha}","comments_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/comments{/number}","issue_comment_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/issues/comments{/number}","contents_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/contents/{+path}","compare_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/merges","archive_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/downloads","issues_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/issues{/number}","pulls_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/pulls{/number}","milestones_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/milestones{/number}","notifications_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/labels{/name}","releases_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/releases{/id}","deployments_url":"https://api.github.com/repos/moodmosaic/dotnet-jack/deployments","created_at":"2016-10-08T07:37:26Z","updated_at":"2016-10-08T07:37:28Z","pushed_at":"2016-10-13T10:08:50Z","git_url":"git://github.com/moodmosaic/dotnet-jack.git","ssh_url":"git@github.com:moodmosaic/dotnet-jack.git","clone_url":"https://github.com/moodmosaic/dotnet-jack.git","svn_url":"https://github.com/moodmosaic/dotnet-jack","homepage":null,"size":77,"stargazers_count":0,"watchers_count":0,"language":"F#","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":"jystic:master","ref":"master","sha":"75a8dceb0b6cda1464d31b6961af21ed9515d155","user":{"login":"jystic","id":134805,"avatar_url":"https://avatars.githubusercontent.com/u/134805?v=3","gravatar_id":"","url":"https://api.github.com/users/jystic","html_url":"https://github.com/jystic","followers_url":"https://api.github.com/users/jystic/followers","following_url":"https://api.github.com/users/jystic/following{/other_user}","gists_url":"https://api.github.com/users/jystic/gists{/gist_id}","starred_url":"https://api.github.com/users/jystic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jystic/subscriptions","organizations_url":"https://api.github.com/users/jystic/orgs","repos_url":"https://api.github.com/users/jystic/repos","events_url":"https://api.github.com/users/jystic/events{/privacy}","received_events_url":"https://api.github.com/users/jystic/received_events","type":"User","site_admin":false},"repo":{"id":70032233,"name":"dotnet-jack","full_name":"jystic/dotnet-jack","owner":{"login":"jystic","id":134805,"avatar_url":"https://avatars.githubusercontent.com/u/134805?v=3","gravatar_id":"","url":"https://api.github.com/users/jystic","html_url":"https://github.com/jystic","followers_url":"https://api.github.com/users/jystic/followers","following_url":"https://api.github.com/users/jystic/following{/other_user}","gists_url":"https://api.github.com/users/jystic/gists{/gist_id}","starred_url":"https://api.github.com/users/jystic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jystic/subscriptions","organizations_url":"https://api.github.com/users/jystic/orgs","repos_url":"https://api.github.com/users/jystic/repos","events_url":"https://api.github.com/users/jystic/events{/privacy}","received_events_url":"https://api.github.com/users/jystic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jystic/dotnet-jack","description":"QuickCheck with shrinking for free","fork":false,"url":"https://api.github.com/repos/jystic/dotnet-jack","forks_url":"https://api.github.com/repos/jystic/dotnet-jack/forks","keys_url":"https://api.github.com/repos/jystic/dotnet-jack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jystic/dotnet-jack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jystic/dotnet-jack/teams","hooks_url":"https://api.github.com/repos/jystic/dotnet-jack/hooks","issue_events_url":"https://api.github.com/repos/jystic/dotnet-jack/issues/events{/number}","events_url":"https://api.github.com/repos/jystic/dotnet-jack/events","assignees_url":"https://api.github.com/repos/jystic/dotnet-jack/assignees{/user}","branches_url":"https://api.github.com/repos/jystic/dotnet-jack/branches{/branch}","tags_url":"https://api.github.com/repos/jystic/dotnet-jack/tags","blobs_url":"https://api.github.com/repos/jystic/dotnet-jack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jystic/dotnet-jack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jystic/dotnet-jack/git/refs{/sha}","trees_url":"https://api.github.com/repos/jystic/dotnet-jack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jystic/dotnet-jack/statuses/{sha}","languages_url":"https://api.github.com/repos/jystic/dotnet-jack/languages","stargazers_url":"https://api.github.com/repos/jystic/dotnet-jack/stargazers","contributors_url":"https://api.github.com/repos/jystic/dotnet-jack/contributors","subscribers_url":"https://api.github.com/repos/jystic/dotnet-jack/subscribers","subscription_url":"https://api.github.com/repos/jystic/dotnet-jack/subscription","commits_url":"https://api.github.com/repos/jystic/dotnet-jack/commits{/sha}","git_commits_url":"https://api.github.com/repos/jystic/dotnet-jack/git/commits{/sha}","comments_url":"https://api.github.com/repos/jystic/dotnet-jack/comments{/number}","issue_comment_url":"https://api.github.com/repos/jystic/dotnet-jack/issues/comments{/number}","contents_url":"https://api.github.com/repos/jystic/dotnet-jack/contents/{+path}","compare_url":"https://api.github.com/repos/jystic/dotnet-jack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jystic/dotnet-jack/merges","archive_url":"https://api.github.com/repos/jystic/dotnet-jack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jystic/dotnet-jack/downloads","issues_url":"https://api.github.com/repos/jystic/dotnet-jack/issues{/number}","pulls_url":"https://api.github.com/repos/jystic/dotnet-jack/pulls{/number}","milestones_url":"https://api.github.com/repos/jystic/dotnet-jack/milestones{/number}","notifications_url":"https://api.github.com/repos/jystic/dotnet-jack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jystic/dotnet-jack/labels{/name}","releases_url":"https://api.github.com/repos/jystic/dotnet-jack/releases{/id}","deployments_url":"https://api.github.com/repos/jystic/dotnet-jack/deployments","created_at":"2016-10-05T05:20:06Z","updated_at":"2016-10-05T05:20:35Z","pushed_at":"2016-10-13T13:20:12Z","git_url":"git://github.com/jystic/dotnet-jack.git","ssh_url":"git@github.com:jystic/dotnet-jack.git","clone_url":"https://github.com/jystic/dotnet-jack.git","svn_url":"https://github.com/jystic/dotnet-jack","homepage":null,"size":76,"stargazers_count":0,"watchers_count":0,"language":"F#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22"},"html":{"href":"https://github.com/jystic/dotnet-jack/pull/22"},"issue":{"href":"https://api.github.com/repos/jystic/dotnet-jack/issues/22"},"comments":{"href":"https://api.github.com/repos/jystic/dotnet-jack/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/jystic/dotnet-jack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jystic/dotnet-jack/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/jystic/dotnet-jack/statuses/04af38792841fdd0799c7d16314ca7ff58fe28db"}}}}
{"actor":{"display_login":"moodmosaic"}}