package sexplib

  1. Overview
  2. Docs

Utility Module for S-expression Conversions

include module type of Sexplib0.Sexp_conv
type sexp_bool = bool
  • deprecated [since 2019-03] use [@sexp.bool] instead
type !'a sexp_option = 'a option
  • deprecated [since 2019-03] use [@sexp.option] instead
type !'a sexp_list = 'a list
  • deprecated [since 2019-03] use [@sexp.list] instead
type !'a sexp_array = 'a array
  • deprecated [since 2019-03] use [@sexp.array] instead
type !'a sexp_opaque = 'a
  • deprecated [since 2019-03] use [@sexp.opaque] instead
val default_string_of_float : (float -> string) Stdlib.ref
val write_old_option_format : bool Stdlib.ref
val read_old_option_format : bool Stdlib.ref
val list_map : ('a -> 'b) -> 'a list -> 'b list
val sexp_of_unit : unit -> Sexplib0__.Sexp.t
val sexp_of_bool : bool -> Sexplib0__.Sexp.t
val sexp_of_string : string -> Sexplib0__.Sexp.t
val sexp_of_bytes : bytes -> Sexplib0__.Sexp.t
val sexp_of_char : char -> Sexplib0__.Sexp.t
val sexp_of_int : int -> Sexplib0__.Sexp.t
val sexp_of_float : float -> Sexplib0__.Sexp.t
val sexp_of_int32 : int32 -> Sexplib0__.Sexp.t
val sexp_of_int64 : int64 -> Sexplib0__.Sexp.t
val sexp_of_nativeint : nativeint -> Sexplib0__.Sexp.t
val sexp_of_ref : ('a -> Sexplib0__.Sexp.t) -> 'a Stdlib.ref -> Sexplib0__.Sexp.t
val sexp_of_lazy_t : ('a -> Sexplib0__.Sexp.t) -> 'a lazy_t -> Sexplib0__.Sexp.t
val sexp_of_option : ('a -> Sexplib0__.Sexp.t) -> 'a option -> Sexplib0__.Sexp.t
val sexp_of_pair : ('a -> Sexplib0__.Sexp.t) -> ('b -> Sexplib0__.Sexp.t) -> ('a * 'b) -> Sexplib0__.Sexp.t
val sexp_of_triple : ('a -> Sexplib0__.Sexp.t) -> ('b -> Sexplib0__.Sexp.t) -> ('c -> Sexplib0__.Sexp.t) -> ('a * 'b * 'c) -> Sexplib0__.Sexp.t
val sexp_of_list : ('a -> Sexplib0__.Sexp.t) -> 'a list -> Sexplib0__.Sexp.t
val sexp_of_array : ('a -> Sexplib0__.Sexp.t) -> 'a array -> Sexplib0__.Sexp.t
val sexp_of_hashtbl : ('a -> Sexplib0__.Sexp.t) -> ('b -> Sexplib0__.Sexp.t) -> ('a, 'b) Stdlib.Hashtbl.t -> Sexplib0__.Sexp.t
val sexp_of_opaque : 'a -> Sexplib0__.Sexp.t
val sexp_of_fun : ('a -> 'b) -> Sexplib0__.Sexp.t
exception Of_sexp_error of exn * Sexplib0__.Sexp.t
val record_check_extra_fields : bool Stdlib.ref
val of_sexp_error : string -> Sexplib0__.Sexp.t -> 'a
val of_sexp_error_exn : exn -> Sexplib0__.Sexp.t -> 'a
val unit_of_sexp : Sexplib0__.Sexp.t -> unit
val bool_of_sexp : Sexplib0__.Sexp.t -> bool
val string_of_sexp : Sexplib0__.Sexp.t -> string
val bytes_of_sexp : Sexplib0__.Sexp.t -> bytes
val char_of_sexp : Sexplib0__.Sexp.t -> char
val int_of_sexp : Sexplib0__.Sexp.t -> int
val float_of_sexp : Sexplib0__.Sexp.t -> float
val int32_of_sexp : Sexplib0__.Sexp.t -> int32
val int64_of_sexp : Sexplib0__.Sexp.t -> int64
val nativeint_of_sexp : Sexplib0__.Sexp.t -> nativeint
val ref_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a Stdlib.ref
val lazy_t_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a lazy_t
val option_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a option
val pair_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> (Sexplib0__.Sexp.t -> 'b) -> Sexplib0__.Sexp.t -> 'a * 'b
val triple_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> (Sexplib0__.Sexp.t -> 'b) -> (Sexplib0__.Sexp.t -> 'c) -> Sexplib0__.Sexp.t -> 'a * 'b * 'c
val list_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a list
val array_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a array
val hashtbl_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> (Sexplib0__.Sexp.t -> 'b) -> Sexplib0__.Sexp.t -> ('a, 'b) Stdlib.Hashtbl.t
val opaque_of_sexp : Sexplib0__.Sexp.t -> 'a
val fun_of_sexp : Sexplib0__.Sexp.t -> 'a
val sexp_of_exn : exn -> Sexplib0__.Sexp.t
val sexp_of_exn_opt : exn -> Sexplib0__.Sexp.t option
module Exn_converter : sig ... end
val ignore : 'a -> unit
val (=) : 'a -> 'a -> bool
Type aliases
type bigstring = (char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t
type float32_vec = (float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.fortran_layout) Stdlib.Bigarray.Array1.t
type float64_vec = (float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.fortran_layout) Stdlib.Bigarray.Array1.t
type vec = float64_vec
type float32_mat = (float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.fortran_layout) Stdlib.Bigarray.Array2.t
type float64_mat = (float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.fortran_layout) Stdlib.Bigarray.Array2.t
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_sexp_grammar : Sexplib0.Private.Raw_grammar.t
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_sexp_grammar : Sexplib0.Sexp.Private.Raw_grammar.t
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_sexp_grammar : Sexplib0.Sexp.Private.Raw_grammar.t
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_sexp_grammar : Sexplib0.Sexp.Private.Raw_grammar.t
val vec_of_sexp : Sexp.t -> vec

vec_of_sexp sexp same as float64_vec_of_sexp.

val float32_mat_sexp_grammar : Sexplib0.Sexp.Private.Raw_grammar.t
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_sexp_grammar : Sexplib0.Sexp.Private.Raw_grammar.t
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_sexp_grammar : Sexplib0.Sexp.Private.Raw_grammar.t
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.