Documentation

Lean.Elab.BuiltinEvalCommand

Implementation of #eval command #

unsafe def Lean.Elab.Command.elabEvalCoreUnsafe (bang : Bool) (tk term : Syntax) (expectedType? : Option Expr) (mkMessage : Expr → MetaM Expr) (silenceUnit : Bool := true) :
Equations
  • One or more equations did not get rendered due to their size.
Instances For
    @[implemented_by Lean.Elab.Command.elabEvalCoreUnsafe]
    opaque Lean.Elab.Command.elabEvalCore (bang : Bool) (tk term : Syntax) (expectedType? : Option Expr) (mkMessage : Expr → MetaM Expr) (silenceUnit : Bool := true) :

    Implements an #eval-like command, as follows.

    The input term is elaborated to e, and mkMessage—which should produce a MessageData—is invoked to render e. When e : m α is a monadic action, and m lifts to one of CommandElabM, TermElabM, MetaM, CoreM or IO through MonadEvalT, mkMessage receives the return value of e; otherwise it receives e. The resulting message is evaluated and logged at tk.

    Evaluation is aborted if e depends on sorryAx and bang is not set.

    mkMessage may throwUnsupportedSyntax to signal that other elaborators should be attempted.

    When e is a monadic action, α ≡ Unit, and silenceUnit is set, mkMessage is skipped and no message is shown.

    When the environment doesn't contain MessageData.ofFormat (e.g. in the prelude), Repr/ToString instances rather than mkMessage are used to render the value.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For