Fix 4.02 compatibility

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-06-15 14:15:27 +07:00 committed by Jeremie Dimino
parent 065e2bb26f
commit f7b3e8af7d
2 changed files with 3 additions and 3 deletions

View File

@ -91,12 +91,12 @@ module Of_sexp = struct
type error = string * hint option
let error ?hint str = Error (str, hint)
let error ?hint str = Result.Error (str, hint)
let errorf ?hint fmt = Printf.ksprintf (error ?hint) fmt
let map_validate t ~f ast =
match f (t ast) with
| Ok b -> b
| Result.Ok b -> b
| Error (msg, hint) -> raise (Of_sexp (Ast.loc ast, msg, hint))
end

View File

@ -87,7 +87,7 @@ module Of_sexp : sig
val error : ?hint:hint -> string -> (_, error) Result.t
val errorf
: ?hint:hint -> ('b, unit, string, (_, error) result) format4 -> 'b
: ?hint:hint -> ('b, unit, string, (_, error) Result.t) format4 -> 'b
val map_validate : 'a t -> f:('a -> ('b, error) Result.t) -> 'b t
end