aboutsummaryrefslogtreecommitdiffstats
path: root/src/CoqUp/Helper.v
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-01-24 12:43:52 +0000
committerYann Herklotz <git@yannherklotz.com>2020-01-24 12:43:52 +0000
commit48e49a65d66b104c54679ab7ad8854b75931d744 (patch)
tree9c1d5810d121eadf21717983ad38789ab6df799d /src/CoqUp/Helper.v
parent9ef4601b795c121622dcc47dfbe947dc378e15bc (diff)
downloadvericert-48e49a65d66b104c54679ab7ad8854b75931d744.tar.gz
vericert-48e49a65d66b104c54679ab7ad8854b75931d744.zip
Added value_to_nat
Diffstat (limited to 'src/CoqUp/Helper.v')
-rw-r--r--src/CoqUp/Helper.v13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/CoqUp/Helper.v b/src/CoqUp/Helper.v
index fef7b9e..f57a16f 100644
--- a/src/CoqUp/Helper.v
+++ b/src/CoqUp/Helper.v
@@ -1,10 +1,15 @@
-Module OptionHelpers.
+Module Option.
-Definition opt_default {T : Type} (x : T) (u : option T) : T :=
+Definition default {T : Type} (x : T) (u : option T) : T :=
match u with
| Some y => y
| None => x
end.
-End OptionHelpers.
-Export OptionHelpers.
+Definition map {S : Type} {T : Type} (f : S -> T) (u : option S) : option T :=
+ match u with
+ | Some y => Some (f y)
+ | None => None
+ end.
+
+End Option.