Safe Haskell | None |
---|---|
Language | GHC2021 |
Rerefined.Predicate.Relational.Internal
Description
Relational operator definitions.
Documentation
Relational operator.
Constructor order is arbitrary due to NEQ
, which obstructs ordering in a
meaningful way.
Note that these operators may be defined by combining Ordering
s in certain
ways: for example
could be LT
OR EQ
LTE
,
could be LT
OR GT
NEQ
.
This is convenient for user intuition, permitting the use of e.g. LT
as a
relational operator directly. However, it complicates type-level work, as now we
can't restrict relational operators to a given kind, and we have to handle
non-standard orderings like
.GT
OR LT
class ReifyRelOp (op :: RelOp) where Source #
Reify a RelOp
.
Methods
reifyRelOp :: Ord a => a -> a -> Bool Source #
The term-level relational operator that op ::
describes.RelOp
Instances
type family WidenRelOp (op :: RelOp) (n :: Natural) (m :: Natural) :: Bool where ... Source #
Equations
WidenRelOp op n n = 'True | |
WidenRelOp 'RelOpLT n m = OrdCond (CmpNat n m) 'True 'True 'False | |
WidenRelOp 'RelOpLTE n m = OrdCond (CmpNat n m) 'True 'True 'False | |
WidenRelOp 'RelOpGTE n m = OrdCond (CmpNat n m) 'False 'True 'True | |
WidenRelOp 'RelOpGT n m = OrdCond (CmpNat n m) 'False 'True 'True | |
WidenRelOp op n m = 'False |