]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/extlib/hExtlib.mli
implemented the first bunch of useful functions
[helm.git] / helm / ocaml / extlib / hExtlib.mli
index 05a8b7d29b6085d8fa947ca29c925f6b43e8d7a7..ad055315e077faf337f0d937fb2b516eada03eab 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2004, HELM Team.
+(* Copyright (C) 2005, HELM Team.
  * 
  * This file is part of HELM, an Hypertextual, Electronic
  * Library of Mathematics, developed at the Computer Science
  * http://helm.cs.unibo.it/
  *)
 
-(** profile s
- * returns a profiling function; [s] is used for labelling the total time at
-   the end of the execution *)
+(** {2 Optional values} *)
+
+val map_option: ('a -> 'b) -> 'a option -> 'b option
+val unopt: 'a option -> 'a  (** @raise Failure *)
+
+(** {2 Filesystem} *)
+
+val is_dir: string -> bool  (** @return true if file is a directory *)
+val is_regular: string -> bool  (** @return true if file is a regular file *)
+val mkdir: string -> unit (** create dir and parents. @raise Failure *)
+
+(** {2 File I/O} *)
+
+val input_file: string -> string  (** read all the contents of file to string *)
+val input_all: in_channel -> string (** read all the contents of a channel *)
+val output_file: filename:string -> text:string -> unit (** other way round *)
+
+(** {2 Exception handling} *)
+
+val finally: (unit -> unit) -> ('a -> 'b) -> 'a -> 'b
+
+(** {2 String processing} *)
+
+val split: ?sep:char -> string -> string list (** @param sep defaults to ' ' *)
+val trim_blanks: string -> string (** strip heading and trailing blanks *)
+
+(** {2 Debugging & Profiling} *)
+
 type profiler = { profile : 'a 'b. ('a -> 'b) -> 'a -> 'b }
+
+  (** @return a profiling function; [s] is used for labelling the total time at
+   * the end of the execution *)
 val profile : string -> profiler
+