{"action":"created","issue":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/2546","repository_url":"https://api.github.com/repos/input-output-hk/cardano-sl","labels_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/2546/labels{/name}","comments_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/2546/comments","events_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/2546/events","html_url":"https://github.com/input-output-hk/cardano-sl/pull/2546","id":298434673,"number":2546,"title":"[WIP] [CL-2312] Generate inductive wallets","user":{"login":"parsonsmatt","id":7310112,"avatar_url":"https://avatars1.githubusercontent.com/u/7310112?v=4","gravatar_id":"","url":"https://api.github.com/users/parsonsmatt","html_url":"https://github.com/parsonsmatt","followers_url":"https://api.github.com/users/parsonsmatt/followers","following_url":"https://api.github.com/users/parsonsmatt/following{/other_user}","gists_url":"https://api.github.com/users/parsonsmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/parsonsmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parsonsmatt/subscriptions","organizations_url":"https://api.github.com/users/parsonsmatt/orgs","repos_url":"https://api.github.com/users/parsonsmatt/repos","events_url":"https://api.github.com/users/parsonsmatt/events{/privacy}","received_events_url":"https://api.github.com/users/parsonsmatt/received_events","type":"User","site_admin":false},"labels":[{"id":531518701,"url":"https://api.github.com/repos/input-output-hk/cardano-sl/labels/wip","name":"wip","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-20T00:13:43Z","updated_at":"2018-02-23T13:29:10Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/pulls/2546","html_url":"https://github.com/input-output-hk/cardano-sl/pull/2546","diff_url":"https://github.com/input-output-hk/cardano-sl/pull/2546.diff","patch_url":"https://github.com/input-output-hk/cardano-sl/pull/2546.patch"},"body":"This PR implements QuickCheck generators for inductive wallets."},"comment":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/comments/368008965","html_url":"https://github.com/input-output-hk/cardano-sl/pull/2546#issuecomment-368008965","issue_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/2546","id":368008965,"user":{"login":"edsko","id":935288,"avatar_url":"https://avatars1.githubusercontent.com/u/935288?v=4","gravatar_id":"","url":"https://api.github.com/users/edsko","html_url":"https://github.com/edsko","followers_url":"https://api.github.com/users/edsko/followers","following_url":"https://api.github.com/users/edsko/following{/other_user}","gists_url":"https://api.github.com/users/edsko/gists{/gist_id}","starred_url":"https://api.github.com/users/edsko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsko/subscriptions","organizations_url":"https://api.github.com/users/edsko/orgs","repos_url":"https://api.github.com/users/edsko/repos","events_url":"https://api.github.com/users/edsko/events{/privacy}","received_events_url":"https://api.github.com/users/edsko/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T13:29:10Z","updated_at":"2018-02-23T13:29:10Z","author_association":"COLLABORATOR","body":"@parsonsmatt Oh, by the way, made one tiny change to your test; you had \r\n\r\n``` haskell\r\n         forAll genInductive $ \\wallet -> conjoin\r\n          [ walletInvariants specEmpty wallet `shouldBe` Right ()\r\n          , walletInvariants incrEmpty wallet `shouldBe` Right ()\r\n          , walletEquivalent specEmpty incrEmpty WalletEmpty `shouldBe` Right ()\r\n          ]\r\n```\r\n\r\nthis `shouldBy` here comes from hspec, and returns a hspec `Expectation`, which is really just a HUnit `Assertion`, which is really just an `IO ()`. This use of `IO` is entirely unnecessary here of course, so I think it's nicer if we avoid IO in QuickCheck where possible. I've also introduced a module `Validated` (isomorphic to `Either e a`, but with some utilities and a `Buildable` instance), so I changed your test to\r\n\r\n``` haskell\r\n         forAll genInductive $ \\wallet -> conjoin\r\n          [ isValidated $ walletInvariants specEmpty wallet\r\n          , isValidated $ walletInvariants incrEmpty wallet\r\n          , isValidated $ walletEquivalent specEmpty incrEmpty WalletEmpty\r\n          ]\r\n```"}}
{"actor":{"display_login":"edsko"}}