Documentation

DY.Meta.Utils

def Lean.MVarId.safeAssign (mvarId : MVarId) (val : Expr) :

Variant of Batteries' Lean.MVarId.assignIfDefEq, using MVarId.checkedAssign (even safer).

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

      This function applies sanitization on expressions to avoid common footguns. There are (at least) two footguns while working with expressions:

      • uninstantiated metavariables
      • metadata These may cause functions such as getAppFnArgs to fail, although when printing the expressions, they should clearly succeed: indeed, the pretty-printer instantiate metavariables first, preventing the success from any debugging attempts. To improve the debugging experience, one may use the option

      set_option pp.instantiateMVars false To avoid problems in the first place, one may use this function pervasively.

      Equations
      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