-
Notifications
You must be signed in to change notification settings - Fork 9
/
lib.mli
93 lines (54 loc) · 3.18 KB
/
lib.mli
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
81
82
83
84
85
86
87
88
89
90
91
92
93
(* ========================================================================== *)
(* FPTaylor: A Tool for Rigorous Estimation of Round-off Errors *)
(* *)
(* Author: Alexey Solovyev, University of Utah *)
(* *)
(* This file is distributed under the terms of the MIT license *)
(* ========================================================================== *)
(* -------------------------------------------------------------------------- *)
(* Operations on lists. *)
(* -------------------------------------------------------------------------- *)
val last : 'a list -> 'a
val insert : 'a -> 'a list -> 'a list
val union : 'a list -> 'a list -> 'a list
val unions : 'a list list -> 'a list
val intersect : 'a list -> 'a list -> 'a list
val subtract : 'a list -> 'a list -> 'a list
val rev_assoc : 'b -> ('a * 'b) list -> 'a
val assoc_eq : ('a -> 'a -> bool) -> 'a -> ('a * 'b) list -> 'b
val assocd : 'b -> 'a -> ('a * 'b) list -> 'b
val assocd_eq : ('a -> 'a -> bool) -> 'b -> 'a -> ('a * 'b) list -> 'b
val (--) : int -> int -> int list
val enumerate : int -> 'a list -> (int * 'a) list
val init_list : int -> (int -> 'a) -> 'a list
(* -------------------------------------------------------------------------- *)
(* Option type operations *)
(* -------------------------------------------------------------------------- *)
val is_none : 'a option -> bool
val is_some : 'a option -> bool
val option_lift : ('a -> 'b) -> default:'b -> 'a option -> 'b
val option_default : default:'a -> 'a option -> 'a
val option_value : 'a option -> 'a
val option_first : 'a option list -> 'a
(* -------------------------------------------------------------------------- *)
(* String operations *)
(* -------------------------------------------------------------------------- *)
val implode : string list -> string
val explode : string -> string list
val print_list : ('a -> unit) -> (unit -> 'b) -> 'a list -> unit
val slice : string -> ?last:int -> first:int -> string
val starts_with : string -> prefix:string -> bool
val concat_env_paths : string list -> string
(* -------------------------------------------------------------------------- *)
(* IO operations. *)
(* -------------------------------------------------------------------------- *)
val load_and_close_channel : bool -> in_channel -> string list
val load_file : string -> string list
val run_cmd : string -> string list
val write_to_file : string -> (Format.formatter -> 'a -> 'b) -> 'a -> 'b
val write_to_string : (Format.formatter -> 'a -> 'b) -> 'a -> string
val write_to_string_result : (Format.formatter -> 'a -> 'b) -> 'a -> string * 'b
val make_path : ?perm:Unix.file_perm -> string -> unit
val get_dir : string -> string
val set_tmp_dir : string -> unit
val get_tmp_dir : unit -> string