package parsexp

  1. Overview
  2. Docs
val parse_string : string -> (Parsexp__.Import.Sexp.t -> 'a) -> ('a id, Conv_error.t) Stdlib.result
val parse_string_exn : string -> (Parsexp__.Import.Sexp.t -> 'a) -> 'a id
val conv : (Parsexp__.Import.Sexp.t * Positions.t) -> (Parsexp__.Import.Sexp.t -> 'a) -> ('a id, Of_sexp_error.t) Stdlib.result
val conv_exn : (Parsexp__.Import.Sexp.t * Positions.t) -> (Parsexp__.Import.Sexp.t -> 'a) -> 'a id
val conv_combine : (Parsexp__.Import.Sexp.t * Positions.t, Parse_error.t) Stdlib.result -> (Parsexp__.Import.Sexp.t -> 'a) -> ('a id, 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
OCaml

Innovation. Community. Security.