package containers

  1. Overview
  2. Docs
A modular, clean and powerful extension of the OCaml standard library

Install

Dune Dependency

Authors

Maintainers

Sources

v3.3.tar.gz
md5=aa946f452a156b7cd0b932b5a849b44e
sha512=fbb6e519ea918afd3895de4cb74bb93a1d7d8899aa1d9def0ee0576a4f648413e3a7d9639040a1117516efb74c66c3432e6da79e6284d2315327175e22766717

doc/containers/CCSexp_intf/module-type-S0/index.html

Module type CCSexp_intf.S0Source

Operations over S-expressions

  • since 2.7
Sourcetype t
Sourcetype sexp = t

Re-exports

Sourceval atom : string -> t

Make an atom out of this string.

  • since 2.8
Sourceval list : t list -> t

Make a Sexpr of this list.

  • since 2.8

Constructors

Sourceval of_int : int -> t
Sourceval of_bool : bool -> t
Sourceval of_list : t list -> t
Sourceval of_rev_list : t list -> t

Reverse the list.

Sourceval of_float : float -> t
Sourceval of_unit : t
Sourceval of_pair : (t * t) -> t
Sourceval of_triple : (t * t * t) -> t
Sourceval of_quad : (t * t * t * t) -> t
Sourceval of_variant : string -> t list -> t

of_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.

Sourceval of_field : string -> t -> t

Used to represent one record field.

Sourceval of_record : (string * t) list -> t

Represent a record by its named fields.

Printing

Sourceval to_buf : Buffer.t -> t -> unit
Sourceval to_string : t -> string
Sourceval to_file : string -> t -> unit
Sourceval to_file_iter : string -> t iter -> unit

Print the given iter of expressions to a file.

Sourceval to_chan : out_channel -> t -> unit
Sourceval pp : Format.formatter -> t -> unit

Pretty-printer nice on human eyes (including indentation).

Sourceval pp_noindent : Format.formatter -> t -> unit

Raw, direct printing as compact as possible.

Parsing

Sourceval parse_string : string -> t or_error

Parse a string.

Sourceval parse_string_list : string -> t list or_error

Parse a string into a list of S-exprs.

  • since 2.8
Sourceval parse_chan : in_channel -> t or_error

Parse 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).

Sourceval parse_chan_gen : in_channel -> t or_error gen

Parse a channel into a generator of S-expressions.

Sourceval parse_chan_list : in_channel -> t list or_error
Sourceval parse_file : string -> t or_error

Open the file and read a S-exp from it.

Sourceval parse_file_list : string -> t list or_error

Open the file and read a S-exp from it.

OCaml

Innovation. Community. Security.