HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Special Inequalities

Substitution

valuesubstituteL :: b :=: c -> b < a -> c < a

Replace the left-hand side of a strict inequality with an equal number.

valuesubstituteR :: b :=: c -> a < b -> a < c

Replace the right-hand side of a strict inequality with an equal number.

Increment

valueincrementL :: a < b -> (c + a) < (c + b)

Add a constant to the left-hand side of both sides of the strict inequality.

valueincrementR :: a < b -> (a + c) < (b + c)

Add a constant to the right-hand side of both sides of the strict inequality.

Decrement

valuedecrementL :: (c + a) < (c + b) -> a < b

Subtract a constant from the left-hand side of both sides of the inequality. This is the opposite of incrementL.

valuedecrementR :: (a + c) < (b + c) -> a < b

Subtract a constant from the right-hand side of both sides of the inequality. This is the opposite of incrementR.

Weaken

valueweakenL :: a < b -> a < (c + b)

Add a constant to the left-hand side of the right-hand side of the strict inequality.

valueweakenR :: a < b -> a < (b + c)

Add a constant to the right-hand side of the right-hand side of the strict inequality.

Composition

valueplus :: a < b -> c <= d -> (a + c) < (b + d)

Add a strict inequality to a nonstrict inequality.

valuetransitive :: a < b -> b < c -> a < c

Compose two strict inequalities using transitivity.

valuetransitiveNonstrictR :: a < b -> b <= c -> a < c

Compose a strict inequality (the first argument) with a nonstrict inequality (the second argument).

Multiplication and Division

Convert to Inequality

Absurdities

Integration with GHC solver

valueconstant :: CmpNat a b ~ 'LT => a < b

Use GHC's built-in type-level arithmetic to prove that one number is less than another. The type-checker only reduces CmpNat if both arguments are constants.

Lift and Unlift