feat: dbgTraceVal

This commit is contained in:
Sebastian Ullrich 2020-07-30 17:30:13 +02:00 committed by Leonardo de Moura
parent 6f7a557e5a
commit 0f7f49aa06

View file

@ -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 : α) : α :=