12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667(*
* Copyright (c) 2013-2022 Thomas Gazagnaire <thomas@gazagnaire.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)moduletypeS=sig(** {1 Path} *)typet(** The type for path values. *)typestep(** Type type for path's steps. *)valempty:t(** The empty path. *)valv:steplist->t(** Create a path from a list of steps. *)valis_empty:t->bool(** Check if the path is empty. *)valcons:step->t->t(** Prepend a step to the path. *)valrcons:t->step->t(** Append a step to the path. *)valdecons:t->(step*t)option(** Deconstruct the first element of the path. Return [None] if the path is
empty. *)valrdecons:t->(t*step)option(** Deconstruct the last element of the path. Return [None] if the path is
empty. *)valmap:t->(step->'a)->'alist(** [map t f] maps [f] over all steps of [t]. *)(** {1 Value Types} *)valt:tType.t(** [t] is the value type for {!type-t}. *)valstep_t:stepType.t(** [step_t] is the value type for {!step}. *)endmoduletypeSigs=sigmoduletypeS=S(** Signature for path implementations.*)(** An implementation of paths as string lists. *)moduleString_list:Swithtypestep=stringandtypet=stringlistend