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 :: (HasOrderX t1 t1, HasOrderX t1 t2, HasOrderX t1 t3, HasOrderX t2 t3, CanAndOrX (OrderCompareType t1 t2) (OrderCompareType t2 t3)) => T t1 -> T t2 -> T t3 -> Spec
- specHasOrderNotMixed :: (HasOrderX t t, CanAndOrX (OrderCompareType t t) (OrderCompareType t t)) => T t -> Spec
- type HasOrderX t1 t2 = (HasOrderCertainly t1 t2, Show t1, Arbitrary t1, Show t2, Arbitrary t2)
- 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 -> Bool 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 -> Bool 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 :: (HasOrderX t1 t1, HasOrderX t1 t2, HasOrderX t1 t3, HasOrderX t2 t3, CanAndOrX (OrderCompareType t1 t2) (OrderCompareType t2 t3)) => T t1 -> T t2 -> T t3 -> Spec Source #
HSpec properties that each implementation of HasOrder
should satisfy.
specHasOrderNotMixed :: (HasOrderX t t, CanAndOrX (OrderCompareType t t) (OrderCompareType t t)) => T t -> Spec Source #
HSpec properties that each implementation of HasOrder
should satisfy.
type HasOrderX t1 t2 = (HasOrderCertainly t1 t2, Show t1, Arbitrary t1, Show t2, Arbitrary t2) Source #
Compound type constraint useful for test definition.
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 #