1234567891011121314151617181920212223242526272829303132333435363738394041424344includeListletrecconcat_map_sep~sep~f=function|[]->[]|[x]->fx|x::xs->lethd=fxinlettl=concat_map_sep~sep~fxsinhd@(sep::tl)letconcat_mapfl=letrecauxfacc=function|[]->revacc|x::l->letxs=fxinauxf(rev_appendxsacc)linauxf[]lletrecfilter_mapaccf=function|hd::tl->letacc=matchfhdwithSomex->x::acc|None->accinfilter_mapaccftl|[]->List.revaccletfilter_mapfx=filter_map[]fx(** @raise Failure if the list is empty. *)letreclast=function|[]->failwith"Odoc_utils.List.last"|[x]->x|_::tl->lasttl(* From ocaml/ocaml *)letrecfind_mapf=function|[]->None|x::l->(matchfxwithSome_asresult->result|None->find_mapfl)letrecfind_optp=function|[]->None|x::l->ifpxthenSomexelsefind_optplletis_empty=function[]->true|_::_->false