aboutsummaryrefslogtreecommitdiff
path: root/lib/option.ml
diff options
context:
space:
mode:
authorglondu2009-09-17 15:58:14 +0000
committerglondu2009-09-17 15:58:14 +0000
commit61ccbc81a2f3b4662ed4a2bad9d07d2003dda3a2 (patch)
tree961cc88c714aa91a0276ea9fbf8bc53b2b9d5c28 /lib/option.ml
parent6d3fbdf36c6a47b49c2a4b16f498972c93c07574 (diff)
Delete trailing whitespaces in all *.{v,ml*} files
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12337 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/option.ml')
-rw-r--r--lib/option.ml28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/option.ml b/lib/option.ml
index 3d98034256..2a530b89bd 100644
--- a/lib/option.ml
+++ b/lib/option.ml
@@ -20,7 +20,7 @@
let has_some = function
| None -> false
| _ -> true
-
+
exception IsNone
(** [get x] returns [y] where [x] is [Some y]. It raises IsNone
@@ -34,11 +34,11 @@ let make x = Some x
(** [init b x] returns [Some x] if [b] is [true] and [None] otherwise. *)
let init b x =
- if b then
+ if b then
Some x
else
None
-
+
(** [flatten x] is [Some y] if [x] is [Some (Some y)] and [None] otherwise. *)
let flatten = function
@@ -48,7 +48,7 @@ let flatten = function
(** {6 "Iterators"} ***)
-(** [iter f x] executes [f y] if [x] equals [Some y]. It does nothing
+(** [iter f x] executes [f y] if [x] equals [Some y]. It does nothing
otherwise. *)
let iter f = function
| Some y -> f y
@@ -60,7 +60,7 @@ exception Heterogeneous
(** [iter2 f x y] executes [f z w] if [x] equals [Some z] and [y] equals
[Some w]. It does nothing if both [x] and [y] are [None]. And raises
[Heterogeneous] otherwise. *)
-let iter2 f x y =
+let iter2 f x y =
match x,y with
| Some z, Some w -> f z w
| None,None -> ()
@@ -92,7 +92,7 @@ let fold_left2 f a x y =
| _ -> raise Heterogeneous
(** [fold_right f x a] is [f y a] if [x] is [Some y], and [a] otherwise. *)
-let fold_right f x a =
+let fold_right f x a =
match x with
| Some y -> f y a
| _ -> a
@@ -112,20 +112,20 @@ let default a = function
(** [lift f x] is the same as [map f x]. *)
let lift = map
-(** [lift_right f a x] is [Some (f a y)] if [x] is [Some y], and
+(** [lift_right f a x] is [Some (f a y)] if [x] is [Some y], and
[None] otherwise. *)
let lift_right f a = function
| Some y -> Some (f a y)
| _ -> None
-(** [lift_left f x a] is [Some (f y a)] if [x] is [Some y], and
+(** [lift_left f x a] is [Some (f y a)] if [x] is [Some y], and
[None] otherwise. *)
let lift_left f x a =
match x with
| Some y -> Some (f y a)
| _ -> None
-(** [lift2 f x y] is [Some (f z w)] if [x] equals [Some z] and [y] equals
+(** [lift2 f x y] is [Some (f z w)] if [x] equals [Some z] and [y] equals
[Some w]. It is [None] otherwise. *)
let lift2 f x y =
match x,y with
@@ -137,18 +137,18 @@ let lift2 f x y =
(** {6 Operations with Lists} *)
module List =
- struct
+ struct
(** [List.cons x l] equals [y::l] if [x] is [Some y] and [l] otherwise. *)
let cons x l =
match x with
| Some y -> y::l
| _ -> l
-
+
(** [List.flatten l] is the list of all the [y]s such that [l] contains
[Some y] (in the same order). *)
let rec flatten = function
| x::l -> cons x (flatten l)
- | [] -> []
+ | [] -> []
end
@@ -157,8 +157,8 @@ end
module Misc =
struct
- (** [Misc.compare f x y] lifts the equality predicate [f] to
- option types. That is, if both [x] and [y] are [None] then
+ (** [Misc.compare f x y] lifts the equality predicate [f] to
+ option types. That is, if both [x] and [y] are [None] then
it returns [true], if they are bothe [Some _] then
[f] is called. Otherwise it returns [false]. *)
let compare f x y =