let left, right = find_left 0, find_right (s_len - 1) in
String.sub s left (right - left + 1)
-(* let rex = Pcre.regexp "^\\s*(.*?)\\s*$" in
- fun s -> (Pcre.extract ~rex s).(1) *)
+(** {2 List processing} *)
+
+let rec list_uniq = function
+ | [] -> []
+ | h::[] -> [h]
+ | h1::h2::tl when h1 = h2 -> list_uniq (h2 :: tl)
+ | h1::tl (* when h1 <> h2 *) -> h1 :: list_uniq tl
(** {2 File predicates} *)
val split: ?sep:char -> string -> string list (** @param sep defaults to ' ' *)
val trim_blanks: string -> string (** strip heading and trailing blanks *)
+(** {2 List processing} *)
+
+val list_uniq: 'a list -> 'a list (* uniq unix filter on lists *)
+
(** {2 Debugging & Profiling} *)
type profiler = { profile : 'a 'b. ('a -> 'b) -> 'a -> 'b }