You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now our laws are a mixture of booleans and TestResult. Use of booleans, such as a > b, will result in quite poor error messages. Ideally, every law failure produces a richly detailed error message, fully utilizing ZIO Test's facilities for reporting.
We fake this right now using <-> as an alternate operator, but this doesn't scale: what would we choose for >, >=, etc.
I think it might be useful to define a new type, like Arbitrary / Arb:
@adamgfraser Thank you! Could use some more development.
It would be great if we didn't have to duplicate Law1, etc. I couldn't think of a way to do that.
EDIT: To give a new meaning to ===, >, etc., it seems we need a wrapper type, hence Arb. But if we have a wrapper type, then it also seems the existing law machinery will be less useful.
It almost argues the law machinery belongs here in ZIO Prelude. But I think it's useful for ZIO Test to support laws even without any type class library.
Right now our laws are a mixture of booleans and
TestResult
. Use of booleans, such asa > b
, will result in quite poor error messages. Ideally, every law failure produces a richly detailed error message, fully utilizing ZIO Test's facilities for reporting.We fake this right now using
<->
as an alternate operator, but this doesn't scale: what would we choose for>
,>=
, etc.I think it might be useful to define a new type, like
Arbitrary
/Arb
:Then to define (redefine?)
Law1
, etc. classes such that they are passedArb[A]
instead ofA
.Then laws can have this form:
But they will generate detailed error messages.
/cc @adamgfraser
The text was updated successfully, but these errors were encountered: