summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_oasis4
-rw-r--r--src/message.ml8
-rw-r--r--src/vyconf_config.ml2
-rw-r--r--src/vyconf_config.mli2
4 files changed, 8 insertions, 8 deletions
diff --git a/_oasis b/_oasis
index d2de4fc..58eae3f 100644
--- a/_oasis
+++ b/_oasis
@@ -13,7 +13,7 @@ Plugins: META (0.4), DevFiles (0.4)
Library "vyconf"
Path: src
- Modules: Vytree, Vylist, Value_checker
+ Modules: Vytree, Vylist, Value_checker, Vyconf_config
Install: false
Library "vytree"
@@ -65,7 +65,7 @@ Executable "vyconfd"
Path: src
MainIs: vyconfd.ml
CompiledObject: best
- BuildDepends: ppx_deriving_yojson.runtime, lwt, lwt.unix
+ BuildDepends: ppx_deriving.runtime, ppx_deriving_yojson.runtime, lwt, lwt.unix, lwt.ppx, vyconf
Executable "vytree_test"
Path: test
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