Parsexp.Conv_many_at_once
val parse_string : string -> (sexp_list -> 'a) -> ('a id, Conv_error.t) result
val conv :
(sexp_list * Positions.t) ->
(sexp_list -> 'a) ->
('a id, Of_sexp_error.t) result
val conv_exn : (sexp_list * Positions.t) -> (sexp_list -> 'a) -> 'a id
val conv_combine :
(sexp_list * Positions.t, Parse_error.t) result ->
(sexp_list -> 'a) ->
('a id, Conv_error.t) 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