Copyright | (c) Michal Konecny |
---|---|
License | BSD3 |
Maintainer | mikkonecny@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
- type HasOrder t1 t2 = (HasOrderAsymmetric t1 t2, HasOrderAsymmetric t2 t1, OrderCompareType t1 t2 ~ OrderCompareType t2 t1)
- class IsBool (OrderCompareType a b) => HasOrderAsymmetric a b where
- type OrderCompareType a b
- (>) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b
- (<) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b
- (<=) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b
- (>=) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b
- type HasOrderCertainlyAsymmetric t1 t2 = (HasOrderAsymmetric t1 t2, CanTestCertainly (OrderCompareType t1 t2))
- type HasOrderCertainly t1 t2 = (HasOrder t1 t2, CanTestCertainly (OrderCompareType t1 t2))
- type HasOrderCertainlyCE es t1 t2 = (HasOrderCertainly t1 t2, HasOrderCertainly (EnsureCE es t1) (EnsureCE es t2))
- type HasOrderCertainlyCN t1 t2 = HasOrderCertainlyCE NumErrors t1 t2
- (?<=?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- (?<?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- (?>=?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- (?>?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- (!<=!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- (!<!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- (!>=!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- (!>!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool
- specHasOrder :: (Show t1, Show t2, Show t3, Arbitrary t1, Arbitrary t2, Arbitrary t3, CanTestCertainly (OrderCompareType t1 t1), CanTestCertainly (OrderCompareType t1 t2), CanTestCertainly (OrderCompareType t2 t1), CanTestCertainly (OrderCompareType t2 t3), CanTestCertainly (AndOrType (OrderCompareType t1 t2) (OrderCompareType t2 t3)), CanAndOrAsymmetric (OrderCompareType t1 t2) (OrderCompareType t2 t3), HasOrderAsymmetric t1 t1, HasOrderAsymmetric t1 t2, HasOrderAsymmetric t2 t1, HasOrderAsymmetric t2 t3) => T t1 -> T t2 -> T t3 -> Spec
- specHasOrderNotMixed :: (Show t, Arbitrary t, CanTestCertainly (OrderCompareType t t), CanTestCertainly (AndOrType (OrderCompareType t t) (OrderCompareType t t)), HasOrderAsymmetric t t) => T t -> Spec
- class CanTestPosNeg t where
Comparisons in numeric order
type HasOrder t1 t2 = (HasOrderAsymmetric t1 t2, HasOrderAsymmetric t2 t1, OrderCompareType t1 t2 ~ OrderCompareType t2 t1) Source #
class IsBool (OrderCompareType a b) => HasOrderAsymmetric a b where Source #
type OrderCompareType a b Source #
lessThan :: a -> b -> OrderCompareType a b Source #
lessThan :: (OrderCompareType a b ~ Bool, a ~ b, Ord a) => a -> b -> OrderCompareType a b Source #
greaterThan :: a -> b -> OrderCompareType a b Source #
greaterThan :: (HasOrder b a, OrderCompareType b a ~ OrderCompareType a b) => a -> b -> OrderCompareType a b Source #
leq :: a -> b -> OrderCompareType a b Source #
leq :: (OrderCompareType a b ~ Bool, a ~ b, Ord a) => a -> b -> OrderCompareType a b Source #
geq :: a -> b -> OrderCompareType a b Source #
geq :: (HasOrder b a, OrderCompareType b a ~ OrderCompareType a b) => a -> b -> OrderCompareType a b Source #
(>) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b infix 4 Source #
(<) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b infix 4 Source #
(<=) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b infix 4 Source #
(>=) :: HasOrderAsymmetric a b => a -> b -> OrderCompareType a b infix 4 Source #
type HasOrderCertainlyAsymmetric t1 t2 = (HasOrderAsymmetric t1 t2, CanTestCertainly (OrderCompareType t1 t2)) Source #
type HasOrderCertainly t1 t2 = (HasOrder t1 t2, CanTestCertainly (OrderCompareType t1 t2)) Source #
type HasOrderCertainlyCE es t1 t2 = (HasOrderCertainly t1 t2, HasOrderCertainly (EnsureCE es t1) (EnsureCE es t2)) Source #
type HasOrderCertainlyCN t1 t2 = HasOrderCertainlyCE NumErrors t1 t2 Source #
(?<=?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
(?<?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
(?>=?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
(?>?) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
(!<=!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
(!<!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
(!>=!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
(!>!) :: HasOrderCertainlyAsymmetric a b => a -> b -> Bool infix 4 Source #
Tests
specHasOrder :: (Show t1, Show t2, Show t3, Arbitrary t1, Arbitrary t2, Arbitrary t3, CanTestCertainly (OrderCompareType t1 t1), CanTestCertainly (OrderCompareType t1 t2), CanTestCertainly (OrderCompareType t2 t1), CanTestCertainly (OrderCompareType t2 t3), CanTestCertainly (AndOrType (OrderCompareType t1 t2) (OrderCompareType t2 t3)), CanAndOrAsymmetric (OrderCompareType t1 t2) (OrderCompareType t2 t3), HasOrderAsymmetric t1 t1, HasOrderAsymmetric t1 t2, HasOrderAsymmetric t2 t1, HasOrderAsymmetric t2 t3) => T t1 -> T t2 -> T t3 -> Spec Source #
HSpec properties that each implementation of HasOrder
should satisfy.
specHasOrderNotMixed :: (Show t, Arbitrary t, CanTestCertainly (OrderCompareType t t), CanTestCertainly (AndOrType (OrderCompareType t t) (OrderCompareType t t)), HasOrderAsymmetric t t) => T t -> Spec Source #
HSpec properties that each implementation of HasOrder
should satisfy.
Specific comparisons
class CanTestPosNeg t where Source #
isCertainlyPositive :: t -> Bool Source #
isCertainlyNonNegative :: t -> Bool Source #
isCertainlyNegative :: t -> Bool Source #
isCertainlyNonPositive :: t -> Bool Source #
isCertainlyPositive :: HasOrderCertainly t Integer => t -> Bool Source #
isCertainlyNonNegative :: HasOrderCertainly t Integer => t -> Bool Source #
isCertainlyNegative :: HasOrderCertainly t Integer => t -> Bool Source #
isCertainlyNonPositive :: HasOrderCertainly t Integer => t -> Bool Source #