2 * Zack's own OCaml library -- set of "helpers" function for the OCaml language
5 * Stefano Zacchiroli <zack@bononia.it>
7 * This module is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This module is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this module; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23 exception Not_implemented
25 val fold_in : ('a -> string -> 'a) -> 'a -> in_channel -> 'a
26 val iter_in : (string -> unit) -> in_channel -> unit
27 val map_in : (string -> 'a) -> in_channel -> 'a list
28 val input_lines : in_channel -> string list
29 val input_all : in_channel -> string
30 val output_lines : string list -> out_channel -> unit
31 val read_lines : unit -> string list
32 val read_all : unit -> string
33 val unsome : 'a option -> 'a
37 val index : ('a -> bool) -> 'a array -> int
38 val find : ('a -> bool) -> 'a array -> 'a
40 val exists : ('a -> bool) -> 'a array -> bool
41 val for_all : ('a -> bool) -> 'a array -> bool
43 val filter : ('a -> bool) -> 'a array -> 'a array
45 (* val lrotate : ?step:int -> 'a array -> 'a array *)
46 (* val rrotate : ?step:int -> 'a array -> 'a array *)
51 val fold : ('a -> string -> string -> 'a) -> 'a -> Dbm.t -> 'a
56 val keys : ('a, 'b) Hashtbl.t -> 'a list
57 val values : ('a, 'b) Hashtbl.t -> 'b list
59 val remove_all : ('a, 'b) Hashtbl.t -> 'a -> unit
64 val map' : ('a -> 'b) -> 'a list -> 'b list
65 val map_if : ('a -> 'b) -> ('a -> bool) -> 'a list -> 'b list
66 val map_if' : ('a -> 'b) -> ('a -> bool) -> 'a list -> 'b list
68 val assoc_all : 'a -> ('a * 'b) list -> 'b list
69 val assq_all : 'a -> ('a * 'b) list -> 'b list
71 val lrotate : 'a list -> 'a list
72 val rrotate : 'a list -> 'a list
73 (* val List.lrotate: ?step:int -> 'a list -> 'a list *)
74 (* val List.rrotate: ?step:int -> 'a list -> 'a list *)
79 val non : ('a -> bool) -> 'a -> bool
80 val conj : ('a -> bool) -> ('a -> bool) -> 'a -> bool
81 val disj : ('a -> bool) -> ('a -> bool) -> 'a -> bool
82 val imply : ('a -> bool) -> ('a -> bool) -> 'a -> bool
84 val ( &&& ) : ('a -> bool) -> ('a -> bool) -> 'a -> bool
85 val ( ||| ) : ('a -> bool) -> ('a -> bool) -> 'a -> bool
86 val ( => ) : ('a -> bool) -> ('a -> bool) -> 'a -> bool
91 val digit_range : (int * int) list
92 val alpha_upper_range : (int * int) list
93 val alpha_lower_range : (int * int) list
94 val alpha_range : (int * int) list
95 val alphanum_range : (int * int) list
96 val word_range : (int * int) list
98 val char : ?ranges:(int * int) list -> unit -> char
99 val string : ?ranges:(int * int) list -> int -> string
104 val map : ('a -> 'b) -> 'a Stream.t -> 'b Stream.t
105 val fold : ('a -> 'b -> 'a) -> 'a -> 'b Stream.t -> 'a
107 val of_inchan : in_channel -> string Stream.t
112 val explode : string -> char list
113 val implode : char list -> string
115 val chomp : string -> string
117 val map : (char -> char) -> string -> unit
118 val fold_left : ('a -> char -> 'a) -> 'a -> string -> 'a
119 (* val fold_right : (char -> 'a -> 'a) -> string -> 'a -> 'a *)
120 val iter : (char -> unit) -> string -> unit
121 (* val filter : (char -> bool) -> string -> string *)
123 val init : int -> (int -> char) -> string
129 val copy : src:string -> dst:string -> unit
135 (* val mkdir : ?parents:bool -> string -> unit *)
137 val is_regular : ?follow_symlink:bool -> string -> bool
138 val is_directory : ?follow_symlink:bool -> string -> bool
139 val is_chardev : ?follow_symlink:bool -> string -> bool
140 val is_blockdev : ?follow_symlink:bool -> string -> bool
141 val is_symlink : ?follow_symlink:bool -> string -> bool
142 val is_fifo : ?follow_symlink:bool -> string -> bool
143 val is_socket : ?follow_symlink:bool -> string -> bool
145 val size : ?follow_symlink:bool -> string -> int
147 val ls : string -> string list