File: interface_tools.mli

package info (click to toggle)
ocaml-stdcompat 19-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,516 kB
  • sloc: ml: 27,806; sh: 875; makefile: 246
file content (80 lines) | stat: -rw-r--r-- 1,634 bytes parent folder | download | duplicates (2)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
module Option : sig
  type 'a t = 'a option

  val map : ('a -> 'b) -> 'a option -> 'b option

  val equal : ('a -> 'b -> bool) -> 'a option -> 'b option -> bool

  val exists : ('a -> bool) -> 'a option -> bool

  val some : 'a -> 'a option

  val iter : ('a -> unit) -> 'a option -> unit

  val filter : ('a -> bool) -> 'a option -> 'a option
end

module Version : sig
  type t = {
      major : int;
      minor : int;
      patch : int;
    }

  val mk : int -> int -> int -> t

  val compare : t -> t -> int

  val equal : t -> t -> bool

  val hash : t -> int

  val of_string : string -> t

(*
  val of_command_line : string -> t
*)

  val to_string : ?sep:string -> ?include_patch:bool -> t -> string
end

val signature_of_in_channel :
    ?filename:string -> in_channel -> Parsetree.signature

(*
module Interpreter : sig
  type t = {
      command_line : string;
      version : Version.t;
    }

  val of_command_line : string -> t
end
*)

module Buffer : sig
  include module type of (struct include Buffer end)

  val add_channel_no_wait : Buffer.t -> in_channel -> int -> int

  val add_channel_to_the_end : ?chunk_size:int -> ?continue:(unit -> bool) ->
    Buffer.t -> in_channel -> unit

  val suffix_of_length : Buffer.t -> int -> string

  val has_suffix : Buffer.t -> string -> bool
end

module String : sig
  include module type of (struct include String end)

  val suffix_of_length : string -> int -> string

  val has_suffix : string -> suffix:string -> bool

  val prefix_of_length : string -> int -> string

  val has_prefix : string -> prefix:string -> bool

  val suffix_from : string -> int -> string
end