HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-internal-9.1003.0Haskell2010

GHC.Internal.Data.Type.Ord

Basic operations on type-level Orderings.

  • 11 types
familytype family Compare (a :: k) (b :: k) :: Ordering
#

Compare branches on the kind of its arguments to either compare by Symbol or Nat.

Instances3Compare
  • type Compare a b = CmpChar a bDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Ord
  • type Compare a b = CmpSymbol a bDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Ord
  • type Compare a b = CmpNat a bDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Ord
typetype (<=) (x :: t) (y :: t) = Assert (x <=? y) (LeErrMsg x y)
#

Comparison (<=) of comparable types, as a constraint.

typetype (>=) (x :: t) (y :: t) = Assert (x >=? y) (GeErrMsg x y)
#

Comparison (>=) of comparable types, as a constraint.

typetype (>) (x :: t) (y :: t) = Assert (x >? y) (GtErrMsg x y)
#

Comparison (>) of comparable types, as a constraint.

typetype (<) (x :: t) (y :: t) = Assert (x <? y) (LtErrMsg x y)
#

Comparison (<) of comparable types, as a constraint.

typetype Max (m :: k) (n :: k) = OrdCond (Compare m n) n n m
#

Maximum between two comparable types.

typetype Min (m :: k) (n :: k) = OrdCond (Compare m n) m m n
#

Minimum between two comparable types.

familytype family OrdCond (o :: Ordering) (lt :: k) (eq :: k) (gt :: k) :: k where
#

A case statement on Ordering.

OrdCond c l e g is l when c ~ LT, e when c ~ EQ, and g when c ~ GT.

Equations