Documentation

Lean.CoreM

Equations
structure Lean.Core.State:
Type

State for the CoreM monad.

Equations
  • Lean.Core.instInhabitedState = { default := { env := default, nextMacroScope := default, ngen := default, traceState := default, cache := default, messages := default } }
structure Lean.Core.Context:
Type

Context for the CoreM monad.

@[inline]
abbrev Lean.Core.CoreM (α : Type) :
Type

CoreM is a monad for manipulating the Lean environment. It is the base monad for MetaM. The main features it provides are:

  • name generator state
  • environment state
  • Lean options context
  • the current open namespace
Equations
Equations
  • Lean.Core.instInhabitedCoreM = { default := fun x x => throw default }
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
Equations
  • One or more equations did not get rendered due to their size.
Equations
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
@[inline]
Equations
  • One or more equations did not get rendered due to their size.
@[inline]
Equations
@[inline]
Equations
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
@[inline]
def Lean.Core.liftIOCore {α : Type} (x : IO α) :
Equations
Equations
Equations
  • One or more equations did not get rendered due to their size.

Restore backtrackable parts of the state.

Equations
  • Lean.Core.restore b = modify fun s => { env := b.env, nextMacroScope := s.nextMacroScope, ngen := s.ngen, traceState := s.traceState, cache := s.cache, messages := b.messages }
@[inline]
Equations
@[inline]
Equations
@[inline]
Equations
  • One or more equations did not get rendered due to their size.
instance Lean.Core.instMetaEvalCoreM {α : Type} [inst : Lean.MetaEval α] :
Equations
  • One or more equations did not get rendered due to their size.
def Lean.Core.withIncRecDepth {m : TypeType u_1} {α : Type} [inst : Monad m] [inst : MonadControlT Lean.CoreM m] (x : m α) :
m α
Equations
def Lean.Core.throwMaxHeartbeat (moduleName : Lean.Name) (optionName : Lean.Name) (max : Nat) :
Equations
  • One or more equations did not get rendered due to their size.
def Lean.Core.checkMaxHeartbeatsCore (moduleName : String) (optionName : Lean.Name) (max : Nat) :
Equations
  • One or more equations did not get rendered due to their size.
Equations
def Lean.Core.withCurrHeartbeats {m : TypeType u_1} {α : Type} [inst : Monad m] [inst : MonadControlT Lean.CoreM m] (x : m α) :
m α
Equations
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
@[inline]
def Lean.catchInternalId {m : Type u_1Type u_2} {α : Type u_1} [inst : Monad m] [inst : MonadExcept Lean.Exception m] (id : Lean.InternalExceptionId) (x : m α) (h : Lean.Exceptionm α) :
m α
Equations
  • One or more equations did not get rendered due to their size.
@[inline]
def Lean.catchInternalIds {m : Type u_1Type u_2} {α : Type u_1} [inst : Monad m] [inst : MonadExcept Lean.Exception m] (ids : List Lean.InternalExceptionId) (x : m α) (h : Lean.Exceptionm α) :
m α
Equations
  • One or more equations did not get rendered due to their size.

Return true if ex was generated by throwMaxHeartbeat. This function is a bit hackish. The heartbeat exception should probably be an internal exception. We used a similar hack at Exception.isMaxRecDepth

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