Equations
- Lean.instInhabitedTraceElem = { default := { ref := default, msg := default } }
Equations
- Lean.instInhabitedTraceState = { default := { enabled := default, traces := default } }
- modifyTraceState : (Lean.TraceState → Lean.TraceState) → m Unit
- getTraceState : m Lean.TraceState
instance
Lean.instMonadTrace
(m : Type → Type)
(n : Type → Type)
[inst : MonadLift m n]
[inst : Lean.MonadTrace m]
:
Equations
- Lean.instMonadTrace m n = { modifyTraceState := fun f => liftM (Lean.modifyTraceState f), getTraceState := liftM Lean.getTraceState }
def
Lean.printTraces
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : MonadLiftT IO m]
:
m Unit
Equations
- Lean.printTraces = do let traceState ← Lean.getTraceState Std.PersistentArray.forM traceState.traces fun m => do let d ← liftM (Lean.MessageData.format m.msg) liftM (IO.println d)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.checkTraceOption opts cls = if Lean.KVMap.isEmpty opts = true then false else Lean.checkTraceOptionAux opts (`trace ++ cls)
@[inline]
def
Lean.isTracingEnabledFor
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadOptions m]
(cls : Lean.Name)
:
m Bool
Equations
- Lean.isTracingEnabledFor cls = do let s ← Lean.getTraceState if (!s.enabled) = true then pure false else Lean.checkTraceOptionM cls
@[inline]
def
Lean.enableTracing
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
(b : Bool)
:
m Bool
Equations
- Lean.enableTracing b = do let s ← Lean.getTraceState let oldEnabled : Bool := s.enabled Lean.modifyTraceState fun s => { enabled := b, traces := s.traces } pure oldEnabled
@[inline]
@[inline]
def
Lean.modifyTraces
{m : Type → Type}
[inst : Lean.MonadTrace m]
(f : Std.PersistentArray Lean.TraceElem → Std.PersistentArray Lean.TraceElem)
:
m Unit
Equations
- Lean.modifyTraces f = Lean.modifyTraceState fun s => { enabled := s.enabled, traces := f s.traces }
@[inline]
Equations
- Lean.setTraceState s = Lean.modifyTraceState fun x => s
def
Lean.addRawTrace
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadRef m]
[inst : Lean.AddMessageContext m]
(msg : Lean.MessageData)
:
m Unit
Equations
- One or more equations did not get rendered due to their size.
def
Lean.addTrace
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadRef m]
[inst : Lean.AddMessageContext m]
(cls : Lean.Name)
(msg : Lean.MessageData)
:
m Unit
Equations
- One or more equations did not get rendered due to their size.
@[inline]
def
Lean.trace
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadRef m]
[inst : Lean.AddMessageContext m]
[inst : Lean.MonadOptions m]
(cls : Lean.Name)
(msg : Unit → Lean.MessageData)
:
m Unit
Equations
- Lean.trace cls msg = do let a ← Lean.isTracingEnabledFor cls if a = true then Lean.addTrace cls (msg ()) else pure PUnit.unit
@[inline]
def
Lean.traceM
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadRef m]
[inst : Lean.AddMessageContext m]
[inst : Lean.MonadOptions m]
(cls : Lean.Name)
(mkMsg : m Lean.MessageData)
:
m Unit
Equations
- Lean.traceM cls mkMsg = do let a ← Lean.isTracingEnabledFor cls if a = true then do let msg ← mkMsg Lean.addTrace cls msg else pure PUnit.unit
@[inline]
def
Lean.traceCtx
{α : Type}
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadRef m]
[inst : Lean.MonadOptions m]
[inst : MonadFinally m]
(cls : Lean.Name)
(ctx : m α)
:
m α
Equations
- One or more equations did not get rendered due to their size.
def
Lean.MonadTracer.trace
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadRef m]
[inst : Lean.AddMessageContext m]
[inst : Lean.MonadOptions m]
(cls : Lean.Name)
(msg : Unit → Lean.MessageData)
:
m Unit
Equations
- Lean.MonadTracer.trace cls msg = Lean.trace cls msg
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.withNestedTraces
{α : Type}
{m : Type → Type}
[inst : Monad m]
[inst : MonadFinally m]
[inst : Lean.MonadTrace m]
[inst : Lean.MonadRef m]
(x : m α)
:
m α
Equations
- One or more equations did not get rendered due to their size.