aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Init
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2005-03-31 11:39:08 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2005-03-31 11:39:08 +0000
commitec34ec23058bc5708c43604b680ae788e3563a86 (patch)
treebf829b772baceae03d312a1d156e34c974d86220 /theories/Init
parent2a7b522af357fde6b459b642446127bb52a44b13 (diff)
Added option_map
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@6903 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Init')
-rwxr-xr-xtheories/Init/Datatypes.v6
1 files changed, 6 insertions, 0 deletions
diff --git a/theories/Init/Datatypes.v b/theories/Init/Datatypes.v
index d10bea605..48f5c1497 100755
--- a/theories/Init/Datatypes.v
+++ b/theories/Init/Datatypes.v
@@ -61,6 +61,12 @@ Inductive option (A:Set) : Set :=
Implicit Arguments None [A].
+Definition option_map (A B:Set) (f:A->B) o :=
+ match o with
+ | Some a => Some (f a)
+ | None => None
+ end.
+
(** [sum A B], equivalently [A + B], is the disjoint sum of [A] and [B] *)
(* Syntax defined in Specif.v *)
Inductive sum (A B:Set) : Set :=