Source

ocaml-bitbucket / common.ml

Diff from to

common.ml

   include Curl
   include Xcurl
 end
+
+external (|>) : 'a -> ('a -> 'b) -> 'b = "%revapply"
+
+module Result = struct
+  type ('a, 'b) t = [ `Ok of 'a | `Error of 'b ]
+  let return a = `Ok a
+  let fail b = `Error b
+  let bind t f = match t with
+    | `Error b -> `Error b
+    | `Ok a -> f a
+  let (>>=) = bind
+  module Open = struct
+    let (>>=) = bind
+  end
+end