Documentation

Lean.Meta.CoeAttr

The @[coe] attribute, used to delaborate coercion functions as #

When writing a coercion, if the pattern

@[coe]
def A.toB (a : A) : B := sorry

instance : Coe A B where coe := A.toB

is used, then A.toB a will be pretty-printed as ↑a.

The different types of coercions that are supported by the coe attribute.

Instances For
    @[implicit_reducible]
    @[implicit_reducible]

    Information associated to a coercion function to enable sensible delaboration.

    • numArgs : Nat

      The number of arguments to the coercion function

    • coercee : Nat

      The argument index that represents the value being coerced

    • type : CoeFnType

      The type of coercion

    Instances For
      @[implicit_reducible]
      @[implicit_reducible]

      The environment extension for tracking coercion functions for delaboration

      Lookup the coercion information for a given function

      Instances For

        Add name to the coercion extension and add a coercion delaborator for the function.

        Instances For