Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file list.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175includeListLabelstype'at='alistletmap~ft=rev(rev_map~ft)letis_empty=function|[]->true|_->falseletrecfilter_mapl~f=matchlwith|[]->[]|x::l->matchfxwith|None->filter_mapl~f|Somex->x::filter_mapl~fletrecfilter_optl=matchlwith|[]->[]|x::l->matchxwith|None->filter_optl|Somex->x::filter_optlletfilteril~f=letrecfilterili=matchlwith|[]->[]|x::l->leti'=succiiniffixthenx::filterili'elsefilterili'infilteril0letconcat_mapl~f=concat(mapl~f)letrev_partition_map=letreclooplacclaccr~f=matchlwith|[]->(accl,accr)|x::l->match(fx:(_,_)Either.t)with|Lefty->loopl(y::accl)accr~f|Righty->looplaccl(y::accr)~finfunl~f->loopl[][]~fletpartition_mapl~f=letl,r=rev_partition_mapl~fin(revl,revr)type('a,'b)skip_or_either=|Skip|Leftof'a|Rightof'bletrev_filter_partition_map=letreclooplacclaccr~f=matchlwith|[]->(accl,accr)|x::l->matchfxwith|Skip->looplacclaccr~f|Lefty->loopl(y::accl)accr~f|Righty->looplaccl(y::accr)~finfunl~f->loopl[][]~fletfilter_partition_mapl~f=letl,r=rev_filter_partition_mapl~fin(revl,revr)letrecfind_mapl~f=matchlwith|[]->None|x::l->matchfxwith|None->find_mapl~f|Some_asres->resletrecfindl~f=matchlwith|[]->None|x::l->iffxthenSomexelsefindl~fletfind_exnl~f=matchfindl~fwith|Somex->x|None->Code_error.raise"List.find_exn"[]letreclast=function|[]->None|[x]->Somex|_::xs->lastxsletdestruct_last=letrecloopacc=function|[]->None|[x]->Some(revacc,x)|x::xs->loop(x::acc)xsinfunxs->loop[]xsletsortt~compare=sortt~cmp:(funab->Ordering.to_int(compareab))letstable_sortt~compare=stable_sortt~cmp:(funab->Ordering.to_int(compareab))letsort_uniqt~compare=Dune_caml.List.sort_uniq(funab->Ordering.to_int(compareab))tletreccompareab~compare:f:Ordering.t=matcha,bwith|[],[]->Eq|[],_::_->Lt|_::_,[]->Gt|x::a,y::b->match(fxy:Ordering.t)with|Eq->compareab~compare:f|ne->neletrecassoctx=matchtwith|[]->None|(k,v)::t->ifx=kthenSomevelseassoctxletsingletonx=[x]letrecnthti=matcht,iwith|[],_->None|x::_,0->Somex|_::xs,i->nthxs(i-1)letphysically_equal=Pervasives.(==)[@warning"-3"]letinit=letrecloopaccinf=ifi=nthenrevaccelseloop(fi::acc)(i+1)nfinfunn~f->loop[]0nflethd_opt=function|[]->None|x::_->Somexletrecequaleqxsys=matchxs,yswith|[],[]->true|x::xs,y::ys->eqxy&&equaleqxsys|_,_->falselethashfxs=Dune_caml.Hashtbl.hash(map~fxs)letconsxsx=x::xs(* copy&paste from [base] *)letfold_mapt~init~f=letacc=refinitinletresult=mapt~f:(funx->letnew_acc,y=f!accxinacc:=new_acc;y)in!acc,result;;