Legend:
Library
Module
Module type
Parameter
Class
Class type
The first and last points are stored explicitly, not least to ensure that there are two of them. The list of points in the middle is stored in reverse order for convenience when checking the path.
In a path, we might demand that we go from A -> B directly, or A -> B possibly via some other points. This is represented as { first = Direct_point a; last = b; ... } and { first = Point a; last = b; ... } respectively; that is, whether or not it must go directly is stored on the source, not the destination.
A final example: { first = Point a; middle_rev = [Direct_point b]; last = c } matches any sequence of points that starts at a, goes (possibly via some other distinct points) to b, and then directly from b to c.
This and the Event_generator.t do not have the full power of regular expressions Notably, the same point may not appear in a path twice, except for when its second appearance is the last point in the path.
type'a point =
| Direct_pointof'a
| Pointof'a
val sexp_of_point : ('a->Sexplib0.Sexp.t)->'apoint->Sexplib0.Sexp.t
val point_of_sexp : (Sexplib0.Sexp.t ->'a)->Sexplib0.Sexp.t ->'apoint
val compare_point : ('a->'a-> int)->'apoint->'apoint-> int