Dune_rpc_private.ConvBidirectional parsing of canonical s-expressions
val sexp : (Stdune.Sexp.t, values) tiso t to_ from creates a parser for a type 'b out of a parser for a type 'a, where 'a and 'b are isomorphic to one another. The functions to_ and from convert between the two types 'a and 'b. A typical approach for parsing record types is to convert them to/from tuples (via the three, four, etc. combinators) which can be parsed with record, and then use iso to convert the parser for a tuple type into a parser for the original record type.
type error = | Parse_error of {message : string;payload : (string * Stdune.Sexp.t) list;}| Version_error of {since : int * int;until : (int * int) option;message : string;payload : (string * Stdune.Sexp.t) list;}conversion from/to
val error : error -> 'aval to_sexp : ('a, values) t -> 'a -> Stdune.Sexp.tval of_sexp :
('a, values) t ->
version:(int * int) ->
Stdune.Sexp.t ->
('a, error) resultfixpoint f is a helper for creating parsers of recursive data structures such as ASTs. f is a function which returns a parser for a single node in the hierarchy, and f is passed a parser which it can use for parsing children of the current node. fixpoint f then returns a parser for the recursive data structure.
val sexp_for_digest : ('a, 'k) t -> Stdune.Sexp.t