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
    @[reducible, inline]

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

    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) :
      def Lean.Elab.Do.inferControlInfoSeq (doSeq : TSyntax `Lean.Parser.Term.doSeq) :
      Instances For