lean4-htt/library/init/meta/ref.lean
2017-06-12 15:17:00 +02:00

18 lines
716 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) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
prelude
import init.meta.tactic
universes u v
namespace tactic
meta constant ref (α : Type u) : Type u
/-- Create a new reference `r` with initial value `a`, execute `t r`, and then delete `r`. -/
meta constant using_new_ref {α : Type u} {β : Type v} (a : α) (t : ref α → tactic β) : tactic β
/-- Read the value stored in the given reference. -/
meta constant read_ref {α : Type u} : ref α → tactic α
/-- Update the value stored in the given reference. -/
meta constant write_ref {α : Type u} : ref αα → tactic unit
end tactic