Data.Type.Ord (original) (raw)
Description
Basic operations on type-level Orderings.
Since: base-4.16.0.0
Synopsis
- type family Compare a b
- data OrderingI a b where
- type (<=) x y = (x <=? y) ~ 'True
- type (<=?) m n = OrdCond (Compare m n) 'True 'True 'False
- type (>=) x y = (x >=? y) ~ 'True
- type (>=?) m n = OrdCond (Compare m n) 'False 'True 'True
- type (>) x y = (x >? y) ~ 'True
- type (>?) m n = OrdCond (Compare m n) 'False 'False 'True
- type (<) x y = (x >? y) ~ 'True
- type (<?) m n = OrdCond (Compare m n) 'True 'False 'False
- type Max m n = OrdCond (Compare m n) n n m
- type Min m n = OrdCond (Compare m n) m m n
- type family OrdCond o lt eq gt where ...
Documentation
data OrderingI a b where Source #
Ordering data type for type literals that provides proof of their ordering. @since 4.16.0.0
Instances
Instances details
type (<=) x y = (x <=? y) ~ 'True infix 4 Source #
Comparison (<=) of comparable types, as a constraint. @since 4.16.0.0
type (>=) x y = (x >=? y) ~ 'True infix 4 Source #
Comparison (>=) of comparable types, as a constraint. @since 4.16.0.0
type (>) x y = (x >? y) ~ 'True infix 4 Source #
Comparison (>) of comparable types, as a constraint. @since 4.16.0.0
type (<) x y = (x >? y) ~ 'True infix 4 Source #
Comparison (<) of comparable types, as a constraint. @since 4.16.0.0
type family OrdCond o lt eq gt where ... Source #
A case statement on [Ordering](Data-Ord.html#t:Ordering "Data.Ord"). `Ordering c l e g` is l when `c ~ LT`, e when `c ~ EQ`, and g when `c ~ GT`. @since 4.16.0.0