1. camlspotter
  2. spotlib

Commits

camlspotter  committed 12561ed

addex Format.list'

  • Participants
  • Parent commits a410517
  • Branches default

Comments (0)

Files changed (3)

File lib/xformat.ml

View file
  • Ignore whitespace
       fprintf ppf "@[%a@]%t%a" 
 	f x
 	(fun ppf -> fprintf ppf sep)
-	(list sep f) xs
+	(list' sep f) xs
 
 let rec list_sep_strs sep1 sep2 f ppf = function
   | [] -> ()
         sep2
         (list_sep_strs sep1 sep2 f) xs
 
-let rec list_sep_str sep = list_sep_strs sep ""
+let list_sep_str sep = list_sep_strs sep ""
 
 let option f ppf = function
   | None -> Format.fprintf ppf "None"

File lib/xformat.mli

View file
  • Ignore whitespace
 val stderr : t
 
 val list : (t -> unit) -> (t -> 'a -> unit) -> t -> 'a list -> unit
+val list' : (unit, t, unit) format -> (t -> 'a -> unit) -> t -> 'a list -> unit
 val list_sep_strs : string -> string -> (t -> 'a -> unit) -> t -> 'a list -> unit
   (** [list_sep_strs sep1 sep2 elem_formatter ppf elems] formats list of elem [elems] 
       by the formatter for elem [elem_formatter], inserting [sep1], "@,", [sep2]

File lib/xlist.ml

View file
  • Ignore whitespace
       | None -> find_map_opt f xs
 
 (** mapMaybe of Haskell *)
-let rec filter_map f lst =
+let filter_map f lst =
   List.rev (List.fold_left (fun st x ->
     match f x with
     | Some v -> v :: st