Module Cduce_types__AtomSet.V

A module for manipulating atom Values.

The type of atoms with custom operations. Atoms are hash-consed and can be compared with physical equality.

include Custom.T
type t
val dump : Stdlib.Format.formatter -> t -> unit
val check : t -> unit
val equal : t -> t -> bool
val hash : t -> int
val compare : t -> t -> int
type value = Ns.QName.t

An alias type for convenience. Atoms correspond to qualified names with a namespace and a local part (e.g. `xhtml:div, with xhtml being bound to the namespace http://www.w3.org/1999/xhtml). Of course for the most common case (e.g. `nil, `true, `false) the namespace is empty.

val mk : value -> t

mk q creates an atom from a qualified name (see Ns.QName).

val value : t -> value

value a returns a qualified name from an atom.

val mk_ascii : string -> t

mk_ascii a creates an atom with an empty namespace. It does not perform any check on a, for instance mk_ascii "hello:world" creates an atom with an empty namespace and an (illegal) name hello:world (here hello: is made part of the local name.).

val get_ascii : t -> string

get_ascii a returns the local name of an atom.

Formatting functions

val print : Stdlib.Format.formatter -> t -> unit

print fmt a prints an atom to the specified formatter.

val to_string : t -> string

to_string a converts the atom to string

val print_quote : Stdlib.Format.formatter -> t -> unit

print fmt a prints an atom to the specified formatter in ℂDuce syntax.