Module type CCSexp_intf.S0
Operations over S-expressions
- since
- 2.7
type ttype sexp= t
Re-exports
val atom : string -> tMake an atom out of this string.
- since
- 2.8
Constructors
val of_int : int -> tval of_bool : bool -> tval of_list : t list -> tval of_rev_list : t list -> tReverse the list.
val of_float : float -> tval of_unit : tval of_pair : (t * t) -> tval of_triple : (t * t * t) -> tval of_quad : (t * t * t * t) -> tval of_variant : string -> t list -> tof_variant name argsis used to encode algebraic variants into a S-expr. For instanceof_variant "some" [of_int 1]represents the valueSome 1.
Printing
val to_buf : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringval to_file : string -> t -> unitval to_file_iter : string -> t iter -> unitPrint the given iter of expressions to a file.
val to_chan : Stdlib.out_channel -> t -> unitval pp : Stdlib.Format.formatter -> t -> unitPretty-printer nice on human eyes (including indentation).
val pp_noindent : Stdlib.Format.formatter -> t -> unitRaw, direct printing as compact as possible.
Parsing
val parse_chan : Stdlib.in_channel -> t or_errorParse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).
val parse_chan_gen : Stdlib.in_channel -> t or_error genParse a channel into a generator of S-expressions.