X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Fextlib%2FhExtlib.mli;h=0c2206a08bd82339f85cb3ad8c60934b9fcb0aba;hb=1b1a0b78ea59c7f0fe2bf7ffda4a5cda260add35;hp=17e2de2bc0c758603486bcc7dac5e4da14256876;hpb=2e2ce89ad33092676c91fc65960614dc1bcc5bb6;p=helm.git diff --git a/components/extlib/hExtlib.mli b/components/extlib/hExtlib.mli index 17e2de2bc..0c2206a08 100644 --- a/components/extlib/hExtlib.mli +++ b/components/extlib/hExtlib.mli @@ -40,7 +40,6 @@ val safe_rmdir: string -> unit (** removes a dir if it exists and is empty *) val is_dir_empty: string -> bool (** checks if the dir is empty *) val rmdir_descend: string -> unit (** rmdir -p *) - (** find all _files_ whose name matches test under a filesystem root. * Test is passed the filename path relative to the given filesystem root *) val find: ?test:(string -> bool) -> string -> string list @@ -53,6 +52,10 @@ val output_file: filename:string -> text:string -> unit (** other way round *) (** {2 Exception handling} *) + (** @param finalizer finalization function (execution both in case of success + * and in case of raised exception + * @param f function to be invoked + * @param arg argument to be passed to function *) val finally: (unit -> unit) -> ('a -> 'b) -> 'a -> 'b (** {2 Char processing} *) @@ -74,6 +77,14 @@ val list_uniq: val filter_map: ('a -> 'b option) -> 'a list -> 'b list (** filter + map *) val list_concat: ?sep:'a list -> 'a list list -> 'a list (**String.concat-like*) val list_findopt: ('a -> 'b option) -> 'a list -> 'b option +val flatten_map: ('a -> 'b list) -> 'a list -> 'b list +val list_last: 'a list -> 'a + + (** split_nth n l + * @returns two list, the first contains at least n elements, the second the + * remaining one + * @raise Failure when List.length l < n *) +val split_nth: int -> 'a list -> 'a list * 'a list (** {2 Debugging & Profiling} *) @@ -82,7 +93,7 @@ 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 : ?enable:bool -> string -> profiler -val set_profiling_printings : (unit -> bool) -> unit +val set_profiling_printings : (string -> bool) -> unit (** {2 Localized exceptions } *) @@ -94,3 +105,7 @@ val floc_of_loc: int * int -> Token.flocation val dummy_floc: Lexing.position * Lexing.position val raise_localized_exception: offset:int -> Token.flocation -> exn -> 'a + +(* size in KB (SLOW) *) +val estimate_size: 'a -> int +