HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulefin-0.3.2Haskell2010

Data.Type.Nat.LE

Less-than-or-equal relation for (unary) natural numbers Nat.

There are at least three ways to encode this relation.

  • zero : 0 \le m and succ : n \le m \to 1 + n \le 1 + m (this module),

  • refl : n \le n and step : n \le m \to n \le 1 + m (Data.Type.Nat.LE.ReflStep),

  • ex : \exists p. n + p \equiv m (tricky in Haskell).

Depending on a situation, usage ergonomics are different.

Contents
  1. Relation
  2. Decidability
  3. Lemmas
  4. Constructor like
  5. Partial order
  6. Total order
  7. More
Synopsis
  • Packagefin-0.3.2
  • Exports15
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceLE.hs

Relation

classclass LE (n :: Nat) (m :: Nat) where

Total order of Nat, less-than-or-Equal-to, \le .

Methods

Instances2LE
  • LE 'Z mDefined in fin-0.3.2 · Data.Type.Nat.LE
  • (m ~ 'S m', LE n m') => LE ('S n) mDefined in fin-0.3.2 · Data.Type.Nat.LE
datadata LEProof (n :: Nat) (m :: Nat) where

An evidence of n \le m. zero+succ definition.

Constructors

Instances6Eq, Ord, Show, Absurd, Boring, Decidable

Decidability

Lemmas

Constructor like

Partial order

Total order

valueleSwap' :: LEProof n m -> LEProof ('S m) n -> void

\forall n\, m : \mathbb{N}, n \le m \to \neg (1 + m \le n)

Example1 expression
leProof :: LEProof Nat2 Nat3LESucc (LESucc LEZero)
Example1 expression
leSwap (leSwap' (leProof :: LEProof Nat2 Nat3))LESucc (LESucc (LESucc LEZero))
Example1 expression
lePred (leSwap (leSwap' (leProof :: LEProof Nat2 Nat3)))LESucc (LESucc LEZero)

More