summaryrefslogtreecommitdiff
path: root/backends/coq
diff options
context:
space:
mode:
authorSon HO2024-04-26 10:55:47 +0200
committerGitHub2024-04-26 10:55:47 +0200
commit5da597289c1723aa59bf87ad5075675820c18f73 (patch)
treed63e2f44c75634674a3e4eabb57ff08c0ae441ac /backends/coq
parent2df6dd65b84a2fd9aad4f716f323bf3f85bf82db (diff)
parentfe8d14cd8b7ba907d5248d574619e93e6d1d253a (diff)
Merge pull request #125 from zhassan-aws/core-option-unwrap
Add `core::option::unwrap` builtin
Diffstat (limited to 'backends/coq')
-rw-r--r--backends/coq/Primitives.v7
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/coq/Primitives.v b/backends/coq/Primitives.v
index 5ffda12f..b29fce43 100644
--- a/backends/coq/Primitives.v
+++ b/backends/coq/Primitives.v
@@ -564,6 +564,13 @@ Definition core_clone_CloneI128 : core_clone_Clone i128 := {|
clone := fun x => Ok (core_clone_impls_CloneI128_clone x)
|}.
+(** [core::option::{core::option::Option<T>}::unwrap] *)
+Definition core_option_Option_unwrap (T : Type) (x : option T) : result T :=
+ match x with
+ | None => Fail_ Failure
+ | Some x => Ok x
+ end.
+
(*** core::ops *)
(* Trait declaration: [core::ops::index::Index] *)