package sexplib

  1. Overview
  2. Docs

Utility Module for S-expression Conversions

include module type of Base.Exported_for_specific_uses.Sexplib.Conv
type sexp_bool = bool
type !'a sexp_option = 'a option
type !'a sexp_list = 'a list
type !'a sexp_array = 'a array
type !'a sexp_opaque = 'a
val default_string_of_float : (float -> string) Caml.ref
val write_old_option_format : bool Caml.ref
val read_old_option_format : bool Caml.ref
val list_map : ('a -> 'b) -> 'a list -> 'b list
val sexp_of_unit : unit -> Base.Sexp.t
val sexp_of_bool : bool -> Base.Sexp.t
val sexp_of_string : string -> Base.Sexp.t
val sexp_of_char : char -> Base.Sexp.t
val sexp_of_int : int -> Base.Sexp.t
val sexp_of_float : float -> Base.Sexp.t
val sexp_of_int32 : int32 -> Base.Sexp.t
val sexp_of_int64 : int64 -> Base.Sexp.t
val sexp_of_nativeint : nativeint -> Base.Sexp.t
val sexp_of_ref : ('a -> Base.Sexp.t) -> 'a Caml.ref -> Base.Sexp.t
val sexp_of_lazy_t : ('a -> Base.Sexp.t) -> 'a lazy_t -> Base.Sexp.t
val sexp_of_option : ('a -> Base.Sexp.t) -> 'a option -> Base.Sexp.t
val sexp_of_pair : ('a -> Base.Sexp.t) -> ('b -> Base.Sexp.t) -> ('a * 'b) -> Base.Sexp.t
val sexp_of_triple : ('a -> Base.Sexp.t) -> ('b -> Base.Sexp.t) -> ('c -> Base.Sexp.t) -> ('a * 'b * 'c) -> Base.Sexp.t
val sexp_of_list : ('a -> Base.Sexp.t) -> 'a list -> Base.Sexp.t
val sexp_of_array : ('a -> Base.Sexp.t) -> 'a array -> Base.Sexp.t
val sexp_of_hashtbl : ('a -> Base.Sexp.t) -> ('b -> Base.Sexp.t) -> ('a, 'b) MoreLabels.Hashtbl.t -> Base.Sexp.t
val sexp_of_opaque : 'a -> Base.Sexp.t
val sexp_of_fun : ('a -> 'b) -> Base.Sexp.t
exception Of_sexp_error of exn * Base.Sexp.t
val record_check_extra_fields : bool Caml.ref
val of_sexp_error : string -> Base.Sexp.t -> 'a
val of_sexp_error_exn : exn -> Base.Sexp.t -> 'a
val unit_of_sexp : Base.Sexp.t -> unit
val bool_of_sexp : Base.Sexp.t -> bool
val string_of_sexp : Base.Sexp.t -> string
val char_of_sexp : Base.Sexp.t -> char
val int_of_sexp : Base.Sexp.t -> int
val float_of_sexp : Base.Sexp.t -> float
val int32_of_sexp : Base.Sexp.t -> int32
val int64_of_sexp : Base.Sexp.t -> int64
val nativeint_of_sexp : Base.Sexp.t -> nativeint
val ref_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a Caml.ref
val lazy_t_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a lazy_t
val option_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a option
val pair_of_sexp : (Base.Sexp.t -> 'a) -> (Base.Sexp.t -> 'b) -> Base.Sexp.t -> 'a * 'b
val triple_of_sexp : (Base.Sexp.t -> 'a) -> (Base.Sexp.t -> 'b) -> (Base.Sexp.t -> 'c) -> Base.Sexp.t -> 'a * 'b * 'c
val list_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a list
val array_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a array
val hashtbl_of_sexp : (Base.Sexp.t -> 'a) -> (Base.Sexp.t -> 'b) -> Base.Sexp.t -> ('a, 'b) MoreLabels.Hashtbl.t
val opaque_of_sexp : Base.Sexp.t -> 'a
val fun_of_sexp : Base.Sexp.t -> 'a
val sexp_of_exn : exn -> Base.Sexp.t
val sexp_of_exn_opt : exn -> Base.Sexp.t option
module Exn_converter : sig ... end
val ignore : 'a -> unit
val (=) : 'a -> 'a -> bool
Type aliases
type vec = float64_vec
type mat = float64_mat
Conversion of OCaml-values to S-expressions
val sexp_of_bigstring : bigstring -> Sexp.t

sexp_of_bigstring bstr converts a bigstring (character bigarray in C-layout) to an S-expression.

val sexp_of_float32_vec : float32_vec -> Sexp.t

sexp_of_float32_vec vec converts the one-dimensional bigarray vec of 32-bit floats in Fortran-layout to an S-expression.

val sexp_of_float64_vec : float64_vec -> Sexp.t

sexp_of_float64_vec vec converts the one-dimensional bigarray vec of 64-bit floats in Fortran-layout to an S-expression.

val sexp_of_vec : vec -> Sexp.t

sexp_of_vec vec same as Conv.sexp_of_float64_vec.

val sexp_of_float32_mat : float32_mat -> Sexp.t

sexp_of_float32_mat mat converts the two-dimensional bigarray mat of 32-bit floats in Fortran-layout to an S-expression.

val sexp_of_float64_mat : float64_mat -> Sexp.t

sexp_of_float64_mat mat converts the two-dimensional bigarray mat of 64-bit floats in Fortran-layout to an S-expression.

val sexp_of_mat : mat -> Sexp.t

sexp_of_mat mat same as Conv.sexp_of_float64_mat.

val string_of__of__sexp_of : ('a -> Sexp.t) -> 'a -> string

string_of__of__sexp_of conv x converts the OCaml-value x to an S-expression represented as a string by using conversion function conv.

Conversion of S-expressions to OCaml-values
val bigstring_of_sexp : Sexp.t -> bigstring

bigstring_of_sexp sexp converts S-expression sexp to a bigstring (character bigarray in C-layout).

val float32_vec_of_sexp : Sexp.t -> float32_vec

float32_vec_of_sexp sexp converts S-expression sexp to a one-dimensional bigarray of 32-bit floats in Fortran-layout.

val float64_vec_of_sexp : Sexp.t -> float64_vec

float64_vec_of_sexp sexp converts S-expression sexp to a one-dimensional bigarray of 64-bit floats in Fortran-layout.

val vec_of_sexp : Sexp.t -> vec

vec_of_sexp sexp same as float64_vec_of_sexp.

val float32_mat_of_sexp : Sexp.t -> float32_mat

float32_mat_of_sexp sexp converts S-expression sexp to a two-dimensional bigarray of 32-bit floats in Fortran-layout.

val float64_mat_of_sexp : Sexp.t -> float64_mat

float64_mat_of_sexp sexp converts S-expression sexp to a two-dimensional bigarray of 64-bit floats in Fortran-layout.

val mat_of_sexp : Sexp.t -> mat

mat_of_sexp sexp same as Conv.float64_mat_of_sexp.

val of_string__of__of_sexp : (Sexp.t -> 'a) -> string -> 'a

of_string__of__of_sexp conv str converts the S-expression str represented as a string to an OCaml-value by using conversion function conv.

OCaml

Innovation. Community. Security.