package accessor_base

  1. Overview
  2. Docs
include sig ... end
val children : (_, Base.Sexp.t, Base.Sexp.t, [< Accessor_base__.Import.many ]) Accessor.t

Access the immediate children of a list node. Accesses nothing for atoms.

val tuple2 : (_, Base.Sexp.t * Base.Sexp.t, Base.Sexp.t, [< Accessor_base__.Import.variant ]) Accessor.t

Treat a list node with two elements as a tuple.

val field : Base.string -> (_, Base.Sexp.t, Base.Sexp.t, [< Accessor_base__.Import.many ]) Accessor.t

Access any immediately children that are tuples (lists with two elements), where the first component is an atom containing the given string.

val variant : Base.string -> (_, Base.Sexp.t Base.list, Base.Sexp.t, [< Accessor_base__.Import.optional ]) Accessor.t

Access the sexp if it is a list whose first element is an atom containing the given string.

val atoms : (_, Base.string, Base.Sexp.t, [< Accessor_base__.Import.many ]) Accessor.t

Access all the atoms in a sexp, recursively.

val conv : (module Base.Sexpable.S with type t = 'a) -> (_, 'a, Base.Sexp.t, [< Accessor_base__.Import.variant ]) Accessor.t

Access the sexp converted to the given type, or access nothing if conversion fails. This is not always well behaved. For example, the sexp representation of a constructor is case insensitive, so roundtripping from a sexp and back might result in a different sexp.

val conv_strict : (module Base.Sexpable.S with type t = 'a) -> (_, 'a, Base.Sexp.t, [< Accessor_base__.Import.isomorphism ]) Accessor.t

Access the sexp converted to the given type, raising if conversion fails. Just as with conv, this is not always well behaved.