diff options
Diffstat (limited to '')
-rw-r--r-- | backends/lean/Base/Primitives/Base.lean | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/backends/lean/Base/Primitives/Base.lean b/backends/lean/Base/Primitives/Base.lean index 4c5b2795..94134d86 100644 --- a/backends/lean/Base/Primitives/Base.lean +++ b/backends/lean/Base/Primitives/Base.lean @@ -130,6 +130,10 @@ def Result.attach {α: Type} (o : Result α): Result { x : α // o = ok x } := ---------- @[simp] def core.mem.replace (a : Type) (x : a) (_ : a) : a × a := (x, x) +/- [core::option::Option::take] -/ +@[simp] def Option.take (T: Type) (self: Option T): Option T × Option T := (self, .none) +/- [core::mem::swap] -/ +@[simp] def core.mem.swap (T: Type) (a b: T): T × T := (b, a) /-- Aeneas-translated function -- useful to reduce non-recursive definitions. Use with `simp [ aeneas ]` -/ |