Fix 4.02 compatibility
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
065e2bb26f
commit
f7b3e8af7d
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue