feat: dbgTraceVal
This commit is contained in:
parent
6f7a557e5a
commit
0f7f49aa06
1 changed files with 3 additions and 0 deletions
|
|
@ -13,6 +13,9 @@ universes u v
|
|||
def dbgTrace {α : Type u} (s : String) (f : Unit → α) : α :=
|
||||
f ()
|
||||
|
||||
def dbgTraceVal {α : Type u} [HasToString α] (a : α) : α :=
|
||||
dbgTrace (toString a) (fun _ => a)
|
||||
|
||||
/- Display the given message if `a` is shared, that is, RC(a) > 1 -/
|
||||
@[neverExtract, extern "lean_dbg_trace_if_shared"]
|
||||
def dbgTraceIfShared {α : Type u} (s : String) (a : α) : α :=
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue