1. camlspotter
  2. spotlib

Commits

camlspotter  committed 97f568d Merge
  • Participants
  • Parent commits 192edc6, 62cf8cd
  • Branches default

Comments (0)

Files changed (2)

File lib/xlist.ml

View file
   in
   from_to [] f t
 
+let find_opt f ls = try Some (List.find f ls) with Not_found -> None 
+
 let rec find_map_opt f = function
   | [] -> None
   | x::xs ->

File lib/xlist.mli

View file
 val from_to : int -> int -> int list
   (** [from_to f t = [f..t]] *)
 
+val find_opt : ('a -> bool) -> 'a list -> 'a option
 val find_map_opt : ('a -> 'b option) -> 'a list -> 'b option
 val filter_map : ('a -> 'b option) -> 'a list -> 'b list