no_raise is the identity, but by using
'a no_raise in a sexpable type, the
sexp_of_no_raise protects the conversion of
'a to a sexp so that if
it fails, one gets a sexp with an error message about the failure, rather than an
exception being raised.
WARNING: The resulting
no_raise_of_sexp can still raise.
sexp_of_t fails, it returns
Errorrather than raising.
With_text.tis a value paired with the full textual representation of its sexp. This is useful for dealing with the case where you want to keep track of a value along with the format of the s-expression it was generated from, which allows you to maintain formatting details, comments, etc.
of_sexp_allow_extra_fields of_sexp sexp uses
of_sexp to convert
sexp to a
value, but will not fail if there are any extra fields in a record (even deeply
The implementation uses global state, so it is not thread safe.