# Pastebin u27Irvjd -instance Arbitrary Depth where arbitrary = Depth <$> arbitrary +genDepth :: Gen Depth +genDepth = Gen.enumBounded -propDepthDoesNotDecrease :: Depth -> Depth -> Property -propDepthDoesNotDecrease d1 d2 = counterexample ("got: " <> show dsum) $ dsum >= d1 && dsum >= d2 - where dsum = d1 <> d2 +propDepthDoesNotDecrease :: Property +propDepthDoesNotDecrease = property $ do + (d1,d2) <- forAll $ liftA2 (,) genDepth genDepth + let dsum = d1 <> d2 + annotateShow dsum + assert $ dsum >= d1 && dsum >= d2