]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
stdext/Either: A module for type ('a, 'b) t = Left of 'a | Right of 'b
authorMatthias Goergens <Matthias.Goergens@citrix.com>
Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)
committerMatthias Goergens <Matthias.Goergens@citrix.com>
Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)
and helper functions.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
stdext/Makefile
stdext/either.ml

index 728d3ea5b70834c9a5f2350698fc1512727fbbd6..cba57bd53c2a387a54c19147ec4d3b9fe9ac1139 100644 (file)
@@ -22,7 +22,7 @@ OCAML_TEST_LIB = $(shell ocamlfind query oUnit)/oUnit.cmxa
 
 STDEXT_OBJS = fun listext filenameext stringext arrayext hashtblext pervasiveext threadext ring \
        qring fring opt bigbuffer unixext range vIO trie config date encodings fe fecomms \
-       forkhelpers gzip sha1sum zerocheck base64 backtrace tar mapext os
+       forkhelpers gzip sha1sum zerocheck base64 backtrace tar mapext os either
 
 INTF = $(foreach obj, $(STDEXT_OBJS),$(obj).cmi)
 LIBS = stdext.cma stdext.cmxa
index fe0679d4ea293e6209f376a8e7a7d7ea757344cd..42e6fe11addd2f3094f2300cf26577f20b2533d8 100644 (file)
@@ -1,5 +1,4 @@
 open Pervasiveext
-open Listext
 
 type ('a,'b) t = Left of 'a | Right of 'b
 
@@ -13,7 +12,7 @@ let to_option = function
        | Right x -> Some x
        | Left _ -> None
 
-let cat_right l = List.unbox_list ++ List.map to_option $ l
+let cat_right l = Opt.cat_some ++ List.map to_option $ l
 
 let join = function
        | Right (Right x) -> Right x