Module Conv.Make
Parameters
Mode : Mode
Sexp_parser : Parsexp__.Parser.S with type parsed_value = Mode.parsed_sexp
Positions_parser : Parsexp__.Parser.S with type parsed_value = Parsexp.Positions.t
Signature
val parse_string : string -> (chunk_to_conv -> 'a) -> ('a res, Parsexp.Conv_error.t) Stdlib.result
val parse_string_exn : string -> (chunk_to_conv -> 'a) -> 'a res
val conv : (parsed_sexp * Parsexp.Positions.t) -> (chunk_to_conv -> 'a) -> ('a res, Parsexp.Of_sexp_error.t) Stdlib.result
val conv_exn : (parsed_sexp * Parsexp.Positions.t) -> (chunk_to_conv -> 'a) -> 'a res
val conv_combine : (parsed_sexp * Parsexp.Positions.t, Parsexp.Parse_error.t) Stdlib.result -> (chunk_to_conv -> 'a) -> ('a res, Parsexp.Conv_error.t) Stdlib.result
Convenience 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) result
then 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