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
instancesemigroupResult :: SemigroupResultwhereSuccess <> r = r
Failed str <> _ = Failed str
instancemonoidResult :: MonoidResultwhere
mempty = Success
This is a use case I have in mind
log "fromRotationMatrix avoids instability issues when the quaternion has one very small component"
quickCheck \(VerySmallNum e) a b c ->let
testWith p' =
let
p = Rotation.fromQuaternion p'
q = unsafePartial (Rotation.fromRotationMatrix (Rotation.toRotationMatrix p))
in
rApproxEq p q
<?> show { p, q }
in
fold
[ testWith (Quaternion e a b c)
, testWith (Quaternion a e b c)
, testWith (Quaternion a b e c)
, testWith (Quaternion a b c e)
]
Of course I could rewrite this test to call quickCheck four times instead, but I think the instance makes sense, and I think it would be nice to allow writing tests this way. Additionally, if generating random values for a given type is expensive, being able to combine Result values in this way could let you cut down the number of random values you need to generate, since you don't need to call quickCheck as many times.
The text was updated successfully, but these errors were encountered:
How would we feel about the following?
This is a use case I have in mind
Of course I could rewrite this test to call
quickCheck
four times instead, but I think the instance makes sense, and I think it would be nice to allow writing tests this way. Additionally, if generating random values for a given type is expensive, being able to combineResult
values in this way could let you cut down the number of random values you need to generate, since you don't need to callquickCheck
as many times.The text was updated successfully, but these errors were encountered: