package file_path

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file types_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
open! Core

module type Type = sig
  (** Path types are represented as strings. *)
  type t = private string [@@deriving equal, compare, hash, sexp_of, sexp_grammar]

  include Comparator.S with type t := t

  (** Equivalent to [(t :> string)]. *)
  val to_string : t -> string

  module Expert : sig
    (** Used internally for performance purposes, this converts a valid string in
        canonical form for the given path type into a [t]. Calling this on invalid or
        non-canonical strings is safe (i.e. should not cause segfaults) but path accessors
        may return nonsense values. *)
    val unchecked_of_canonical_string : string -> t
  end
end

module type S = sig
  (** A path is a string. *)
  module Path : Type with type t = private string

  (** An absolute path is a path. *)
  module Absolute : Type with type t = private Path.t

  (** A relative path is a path. *)
  module Relative : Type with type t = private Path.t

  (** A path part is a relative path. *)
  module Part : Type with type t = private Relative.t
end

module type Types = sig
  module type Type = Type
  module type S = S

  include S
end