accessor_base

Accessors for Base types, for use with the Accessor library
IN THIS PACKAGE
Module Accessor_base . Sexp
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.