diff options
| author | herbelin | 2005-03-31 11:39:08 +0000 |
|---|---|---|
| committer | herbelin | 2005-03-31 11:39:08 +0000 |
| commit | ec34ec23058bc5708c43604b680ae788e3563a86 (patch) | |
| tree | bf829b772baceae03d312a1d156e34c974d86220 | |
| parent | 2a7b522af357fde6b459b642446127bb52a44b13 (diff) | |
Added option_map
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@6903 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rwxr-xr-x | theories/Init/Datatypes.v | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/theories/Init/Datatypes.v b/theories/Init/Datatypes.v index d10bea6055..48f5c14975 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 := |
