package sexplib0

  1. Overview
  2. Docs
Library containing the definition of S-expressions and some base converters

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
md5=abafe8fd1d6302e55a315f4d78960d2a
sha512=ad387e40789fe70a11473db7e85fe017b801592624414e9030730b2e92ea08f98095fb6e9236430f33c801605ebee0a2a6284e0f618a26a7da4599d4fd9d395d

doc/sexplib0/Sexplib0/Sexp_conv_record/index.html

Module Sexplib0.Sexp_conv_recordSource

Sourcemodule Kind : sig ... end
Sourcemodule Fields : sig ... end
Sourceval record_of_sexp : caller:string -> fields:'a Fields.t -> index_of_field:(string -> int) -> allow_extra_fields:bool -> create:('a -> 'b) -> Sexp.t -> 'b

Parses a record from a sexp that must be a list of fields.

Uses caller as the source for error messages. Parses using the given fields. Uses index_of_field to look up field names found in sexps. If allow_extra_fields is true, extra fields are allowed and discarded without error. create is used to construct the final returned value.

Sourceval record_of_sexps : caller:string -> context:Sexp.t -> fields:'a Fields.t -> index_of_field:(string -> int) -> allow_extra_fields:bool -> create:('a -> 'b) -> Sexp.t list -> 'b

Like record_of_sexp, but for a list of sexps with no List wrapper. Used, for example, to parse arguments to a variant constructor with an inlined record argument. Reports context for parse errors when no more specific sexp is applicable.