lean4-htt/library/init/Lean/util.lean
2019-03-21 15:06:44 -07:00

17 lines
589 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-
Copyright (c) 2019 Sebastian Ullrich. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Sebastian Ullrich
-/
prelude
import init.lean.position init.io
namespace Lean
/-- Print and accumulate run time of `act` when Option `profiler` is set to `True`. -/
@[extern 5 "lean_lean_profileit"]
constant profileit {α : Type} (category : @& String) (pos : @& Position) (act : IO α) : IO α := act
def profileitPure {α : Type} (category : String) (pos : Position) (fn : unit → α) : IO α :=
profileit category pos $ IO.lazyPure fn
end Lean