From 3ff1a05122ffc32304494736d2f8359c8ea1ed3a Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Mon, 3 Feb 2020 06:15:39 +0300 Subject: [PATCH] Include Stdlib.Result on OCaml >= 4.08.0 Signed-off-by: Anton Bachin --- result-as-alias-4.08.ml | 2 ++ result-as-alias.ml | 1 + result-as-newtype.ml | 1 + which_result.ml | 5 ++++- 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 result-as-alias-4.08.ml diff --git a/result-as-alias-4.08.ml b/result-as-alias-4.08.ml new file mode 100644 index 0000000..162ab83 --- /dev/null +++ b/result-as-alias-4.08.ml @@ -0,0 +1,2 @@ +include Stdlib.Result +type ('a, 'b) result = ('a, 'b) Stdlib.Result.t diff --git a/result-as-alias.ml b/result-as-alias.ml index 324055a..5d69581 100644 --- a/result-as-alias.ml +++ b/result-as-alias.ml @@ -1 +1,2 @@ type nonrec ('a, 'b) result = ('a, 'b) result = Ok of 'a | Error of 'b +type ('a, 'b) t = ('a, 'b) result diff --git a/result-as-newtype.ml b/result-as-newtype.ml index b2c7ef5..275c663 100644 --- a/result-as-newtype.ml +++ b/result-as-newtype.ml @@ -1 +1,2 @@ type ('a, 'b) result = Ok of 'a | Error of 'b +type ('a, 'b) t = ('a, 'b) result diff --git a/which_result.ml b/which_result.ml index ba5ee2b..7c40c21 100644 --- a/which_result.ml +++ b/which_result.ml @@ -6,6 +6,9 @@ let () = if version < (4, 03) then "result-as-newtype.ml" else - "result-as-alias.ml" + if version < (4, 08) then + "result-as-alias.ml" + else + "result-as-alias-4.08.ml" in print_string file