1. camlspotter
  2. spotlib

Commits

camlspotter  committed 917a45d Merge
  • Participants
  • Parent commits 41adf19, 59b22df
  • Branches default

Comments (0)

Files changed (2)

File lib/xlist.ml

View file
   in
   aux []
   
+let assoc_opt k l = try Some (List.assoc k l) with Not_found -> None
+
 let scani_left f acc xs =
   let rec scan acc pos xs = match pos, xs with
     | _pos, [] -> acc

File lib/xlist.mli

View file
 val find_opt : ('a -> bool) -> 'a list -> 'a option
 val find_map_opt : ('a -> 'b option) -> 'a list -> 'b option
 val assoc_all : 'a -> ('a * 'b) list -> 'b list
+val assoc_opt : 'a -> ('a * 'b) list -> 'b option
 
 val filter_map : ('a -> 'b option) -> 'a list -> 'b list
 val rev_filter_map : ('a -> 'b option) -> 'a list -> 'b list