Up

module Extended_sexp

: sig

Extensions to Sexplib.Sexp.

#
val is_atom : Core.Std.Sexp.t -> bool
#
val is_list : Core.Std.Sexp.t -> bool

Constructors

#
val atom : string -> Core.Std.Sexp.t
#
val list : Core.Std.Sexp.t list -> Core.Std.Sexp.t

Printing

#
val to_string_hum' : Core.Std.Sexp.t -> string

The ocaml pretty printer (used by sexplib) is a speed daemon but is, sadly enough, produces wrong output (e.g it overflows in places where this could have avoided). This uses a printer from wadler's a prettier printer to output strings suited to human consumption.

#
val format : Core.Std.Sexp.t -> Pp.t
#
val pp_hum' : Format.formatter -> Core.Std.Sexp.t -> unit

A more readable but less compact pretty printer than the one bundled by sexplib. This is going through a test period at which point it might make it in sexplib. It uses ocaml's pretty-printing library so it is both fast and broken.

#
val comment : string -> string

Takes a string and returns the same string but commented according to sexp's syntax

#
module Diff : sig

Various

#
type t
#
val print : ?oc:Pervasives.out_channel -> t -> unit
#
val to_buffer : t -> Buffer.t
#
val to_string : t -> string
#
val of_sexps : original:Core.Std.Sexp.t -> updated:Core.Std.Sexp.t -> t option
end
#
val print_diff : ?oc:Pervasives.out_channel -> original:Core.Std.Sexp.t -> updated:Core.Std.Sexp.t -> unit -> unit
#
val summarize : Core.Std.Sexp.t -> sub_sexp:Core.Std.Sexp.t -> size:[
| `depth of int
| `string of int
] -> Core.Std.Sexp.t

Returns a smaller sexp by replacing sections with "...". Will try to show parts of the sexp "near" sub_sexp.

Limiting size to length a string length is less efficient than a certain depth. The meaning of a given depth is arbitrary except that more depth gives you a bigger sexp. Try 100 or so.

Transforming sexp parsers

#
val filter_record : (Core.Std.Sexp.t -> 'a) -> string list -> Core.Std.Sexp.t -> 'a
#
module Records_table : sig
#
type 'a t = 'a list
include Core.Std.Sexpable.S1 with type 'a t := 'a t
end
#
module Make_explicit_sexp_option : functor (T : sig
#
type t
#
val explicit_sexp_option_fields : string list
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
) -> sig
#
type t = T.t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
#
val load_sexp_conv_exn_sample : ?strict:bool -> ?buf:string -> ?on_non_existence:[
| `Exit
| `Raise
] -> ?name:string -> string -> sexp_of_t:('a -> Core.Std.Sexp.t) -> t_of_sexp:(Core.Std.Sexp.t -> 'a) -> sample:'a -> 'a
#
module Comprehension : sig
#
type 'a t = 'a list
#
val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
#
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
end
end