Documentation

Lean.Elab.Do.InferControlInfo

Represents information about what control effects a do block has.

  • breaks : Bool

    The do block may break.

  • continues : Bool

    The do block may continue.

  • returnsEarly : Bool

    The do block may return early.

  • numRegularExits : Nat

    The number of regular exit paths the do block has. Corresponds to the number of jumps to an ambient join point.

  • reassigns : NameSet

    The variables that are reassigned in the do block.

Instances For
    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
          @[implicit_reducible]
          Equations
          • One or more equations did not get rendered due to their size.
          @[reducible, inline]

          A handler for inferring ControlInfo from a doElem syntax. Register with @[doElem_control_info parserName].

          Equations
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[implemented_by Lean.Elab.Do.mkControlInfoElemAttributeUnsafe]

              Registers a ControlInfo inference handler for the given doElem syntax node kind.

              A handler should have type ControlInfoHandler (i.e. TSyntax \doElem → TermElabM ControlInfo). For pure handlers, use fun stx => return ControlInfo.pure`.

              partial def Lean.Elab.Do.InferControlInfo.ofLetOrReassignArrow (reassignment : Bool) (decl : TSyntax [`Lean.Parser.Term.doIdDecl, `Lean.Parser.Term.doPatDecl]) :
              partial def Lean.Elab.Do.InferControlInfo.ofLetOrReassign (reassigned : Array Ident) (rhs? : Option (TSyntax `doElem)) (otherwise? body? : Option (TSyntax `Lean.Parser.Term.doSeqIndent)) :
              partial def Lean.Elab.Do.InferControlInfo.ofSeq (stx : TSyntax `Lean.Parser.Term.doSeq) :