From 57b51409e44ba895952db6f2e0971a7770092988 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 8 Dec 2016 02:16:56 +0600 Subject: Fix build for ocaml 4.03 Yojson now uses the Result.result type for its decoding functions instead of polymorphic variants. --- src/message.ml | 8 ++++---- src/vyconf_config.ml | 2 +- src/vyconf_config.mli | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/message.ml b/src/message.ml index 3f9e2b9..b79d5cd 100644 --- a/src/message.ml +++ b/src/message.ml @@ -60,8 +60,8 @@ let encode_raw_operation op = let decode_request j = let req = raw_request_of_yojson j in match req with - | `Ok req -> {session_id=req.raw_session_id; operations=(List.map decode_operation req.raw_operations)} - | `Error str -> raise (Invalid_message str) + | Result.Ok req -> {session_id=req.raw_session_id; operations=(List.map decode_operation req.raw_operations)} + | Result.Error str -> raise (Invalid_message str) let encode_request req = let raw_req = {raw_session_id=req.session_id; raw_operations=(List.map encode_raw_operation req.operations)} in @@ -72,5 +72,5 @@ let encode_response = response_to_yojson let decode_response j = let result = response_of_yojson j in match result with - | `Ok response -> response - | `Error str -> raise (Invalid_message str) + | Result.Ok response -> response + | Result.Error str -> raise (Invalid_message str) diff --git a/src/vyconf_config.ml b/src/vyconf_config.ml index 60ac2c9..92fcbb0 100644 --- a/src/vyconf_config.ml +++ b/src/vyconf_config.ml @@ -10,5 +10,5 @@ type vyconf_config = { let load filename = try Yojson.Safe.from_file filename |> vyconf_config_of_yojson - with Sys_error msg -> `Error msg + with Sys_error msg -> Result.Error msg diff --git a/src/vyconf_config.mli b/src/vyconf_config.mli index 52060af..30d8ea7 100644 --- a/src/vyconf_config.mli +++ b/src/vyconf_config.mli @@ -7,4 +7,4 @@ type vyconf_config = { socket: string; } -val load : string -> [ `Error of bytes | `Ok of vyconf_config ] +val load : string -> (vyconf_config, string) Result.result -- cgit v1.2.3