module Parse_error : sig ... endmodule Of_sexp_error : sig ... endmodule Conv_error : sig ... endval parse_string : string ‑> (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t ‑> 'a) ‑> ('a single_or_many, Conv_error.t) Pervasives.resultval parse_string_exn : string ‑> (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t ‑> 'a) ‑> 'a single_or_manyval conv : (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t single_or_many * Positions.t) ‑> (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t ‑> 'a) ‑> ('a single_or_many, Of_sexp_error.t) Pervasives.resultval conv_exn : (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t single_or_many * Positions.t) ‑> (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t ‑> 'a) ‑> 'a single_or_manyval conv_combine : (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t single_or_many * Positions.t, Parse_error.t) Pervasives.result ‑> (Parsexp__.Import.Ppx_sexp_conv_lib.Sexp.t ‑> 'a) ‑> ('a single_or_many, Conv_error.t) Pervasives.resultConvenience function for merging parsing and conversion errors.
For instance if you have a load function as follow:
val load : string -> (Sexp.t list * Positions.t, Parse_error.t) resultthen you can create a load_conv function as follow:
let load_conv : string -> (Sexp.t -> 'a) -> ('a list, Conv_error.t) result
= fun filename f -> conv_combine (load filename) f