diff options
author | Son Ho | 2024-04-25 16:07:56 +0200 |
---|---|---|
committer | Son Ho | 2024-04-25 16:07:56 +0200 |
commit | 078b7f59ddfcb12a7b4c69f0a51bfd57cb391ddf (patch) | |
tree | ed45664329e24d1773be6c8bcaf827e2adbd3f65 /backends/lean | |
parent | 1728dced8484befe35ef61fdf4ccd62b93fbb19d (diff) | |
parent | a3e38d5f47e4780768902e49e28e471e38efd40a (diff) |
Merge branch 'main' into core-option-unwrap
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 ac4fd340..d682e926 100644 --- a/backends/lean/Base/Primitives/Base.lean +++ b/backends/lean/Base/Primitives/Base.lean @@ -135,6 +135,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 ]` -/ |