]> matita.cs.unibo.it Git - helm.git/blob - helm/http_getter/zack.mli
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / http_getter / zack.mli
1 (*
2  * Zack's own OCaml library -- set of "helpers" function for the OCaml language
3  *
4  * Copyright (C) 2003:
5  *    Stefano Zacchiroli <zack@bononia.it>
6  *
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.
11  *
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.
16  *
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,
20  *  MA  02111-1307, USA.
21  *)
22
23 exception Not_implemented
24
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
34
35 module Array :
36   sig
37     val index : ('a -> bool) -> 'a array -> int
38     val find : ('a -> bool) -> 'a array -> 'a
39
40     val exists : ('a -> bool) -> 'a array -> bool
41     val for_all : ('a -> bool) -> 'a array -> bool
42
43     val filter : ('a -> bool) -> 'a array -> 'a array
44
45 (*     val lrotate : ?step:int -> 'a array -> 'a array *)
46 (*     val rrotate : ?step:int -> 'a array -> 'a array *)
47   end
48
49 module Dbm :
50   sig
51     val fold : ('a -> string -> string -> 'a) -> 'a -> Dbm.t -> 'a
52   end
53
54 module Hashtbl :
55   sig
56     val keys : ('a, 'b) Hashtbl.t -> 'a list
57     val values : ('a, 'b) Hashtbl.t -> 'b list
58
59     val remove_all : ('a, 'b) Hashtbl.t -> 'a -> unit
60   end
61
62 module List :
63   sig
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
67
68     val assoc_all : 'a -> ('a * 'b) list -> 'b list
69     val assq_all : 'a -> ('a * 'b) list -> 'b list
70
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 *)
75   end
76
77 module Logic :
78   sig
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
83
84     val ( &&& ) : ('a -> bool) -> ('a -> bool) -> 'a -> bool
85     val ( ||| ) : ('a -> bool) -> ('a -> bool) -> 'a -> bool
86     val ( => ) : ('a -> bool) -> ('a -> bool) -> 'a -> bool
87   end
88
89 module Random :
90   sig
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
97
98     val char : ?ranges:(int * int) list -> unit -> char
99     val string : ?ranges:(int * int) list -> int -> string
100   end
101
102 module Stream :
103   sig
104     val map : ('a -> 'b) -> 'a Stream.t -> 'b Stream.t
105     val fold : ('a -> 'b -> 'a) -> 'a -> 'b Stream.t -> 'a
106
107     val of_inchan : in_channel -> string Stream.t
108   end
109
110 module String :
111   sig
112     val explode : string -> char list
113     val implode : char list -> string
114
115     val chomp : string -> string
116
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 *)
122
123     val init : int -> (int -> char) -> string
124   end
125
126 (*
127 module Sys :
128   sig
129     val copy : src:string -> dst:string -> unit
130   end
131 *)
132
133 module Unix :
134   sig
135 (*     val mkdir : ?parents:bool -> string -> unit *)
136
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
144
145     val size : ?follow_symlink:bool -> string -> int
146
147     val ls : string -> string list
148   end
149