Documentation

Lean.Elab.ErrorUtils

Error-writing utilities #

This module presents some convenience utilities for writing error and status messages in the Lean compiler.

New operations on lists and strings are intended to operate through the dot-notation-respects-notation mechanism (https://juliahimmel.de/blog/an-underappreciated-lean-feature). To use n.toOrdinal in a module, first open Lean.Internal.ErrorUtils.

Translate numbers (1, 2, 3, 212, 322 ...) to ordinals with appropriate English-language names for small ordinals (0 through 10 become "zeroth" through "tenth") and postfixes for other numbers (212 becomes "212th" and 1292 becomes "1292nd").

Equations
Instances For
    • emp : α
    • and : α
    • comma : α
    • commaAnd : α
    Instances
      @[instance_reducible]
      Equations
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      • singular : α
      • plural : α → α
      Instances
        def Lean.Internal.ErrorUtils.Nat.plural {α : Sort u_1} [HasPluralDefaults α] (count : Nat) (singular : α := HasPluralDefaults.singular) (plural : α := HasPluralDefaults.plural singular) :
        α

        Give alternative forms of a string if the count is 1 or not.

        Equations
        Instances For