Module Syncom.Identifier

String identifiers.

An identifier is a string with a location. The string may contain a '#' prefix for parameter variables or a '$' prefix for substitution variables.

Identifiers are totally ordered for efficient lookups in map data structures.

For identifiers prefixed by modules, see Qualified_identifier.

type t

Constructors

val make : ?location:Location.t -> Support.String.t -> t

Destructors

val location : t -> Location.t
val name : t -> Support.String.t

Exceptions

exception Unbound_identifier of t

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Lists

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.