aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/util.mli
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-03-13 17:48:28 +0100
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-03-13 17:48:28 +0100
commit0dfd0fb7d7c04eedfb3b161b9b5cfab103c17916 (patch)
tree9517b8e5e12cc25e20dc436e5086bfd216739a7b /lib/util.mli
parent04b7394eaae170685a09ccd85ef47991466e6681 (diff)
Adding a few functions on type union.
Diffstat (limited to 'lib/util.mli')
-rw-r--r--lib/util.mli8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/util.mli b/lib/util.mli
index 559874bb8..6bed7e355 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -114,7 +114,15 @@ val iraise : iexn -> 'a
type ('a, 'b) union = ('a, 'b) CSig.union = Inl of 'a | Inr of 'b
(** Union type *)
+module Union :
+sig
+ val map : ('a -> 'c) -> ('b -> 'd) -> ('a, 'b) union -> ('c, 'd) union
+ val equal : ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) union -> ('a, 'b) union -> bool
+ val fold_left : ('c -> 'a -> 'c) -> ('c -> 'b -> 'c) -> 'c -> ('a, 'b) union -> 'c
+end
+
val map_union : ('a -> 'c) -> ('b -> 'd) -> ('a, 'b) union -> ('c, 'd) union
+(** Alias for [Union.map] *)
type 'a until = 'a CSig.until = Stop of 'a | Cont of 'a
(** Used for browsable-until structures. *)