-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BindReturn to Property CE #364
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
15e5e6c
to
baa0c93
Compare
baa0c93
to
136f3c3
Compare
This comment has been minimized.
This comment has been minimized.
136f3c3
to
e57d545
Compare
Separate from this PR, I merged in the code that adds and then uses |
81a6ac4
to
31eb928
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'm a bit late, but I think failOnFalse
should've been named failureWhenFalse
for two reasons:
- It's called
Failure
in Hedgehog. failwith
exists. My mind conflatesfailOnFalse
with that, so seeingproperty { ... } |> Property.failOnFalse |> Property.check
is slightly surprising.fail
is (mostly) a verb, whilefailure
is (mostly) a noun.
Oh well.
Did you intentionally not use checkBool
on your tests?
Otherwise LGTM!
I agree that |
ac40743
to
ea75302
Compare
8459fba
to
a63f90c
Compare
a63f90c
to
ee95ed0
Compare
This PR is makes progress on issue #332. This PR should be merged before PR #336 (which is still only a draft). After this PR is merged, I will force push an update to the branch in that PR that includes a rebase on top of the branch in this PR.
The main point of this PR is to add
BindReturn
to theProperty
computational expression. As the corresponding RFC saysThat is preciously what we need to avoid testing non-shrunken inputs during rechecking.
One "controversial" thing this PR does is remove the
Return(bool)
method from theProperty
CE. I removed it because having both this method andBindReturn
were giving me compiler errors. RemovingReturn(bool)
was the only solution that I found. Maybe there is another one we could use instead. However,Return(bool)
is not necessary. It is syntactic sugar that allows the user to omit putting|> Property.failOnFalse
after their CE instance. Therefore, I think it is reasonable to remove this.