Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file indexed_container_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101type('t,'a,'accum)fold='t->init:'accum->f:('accum->'a->'accum)->'accumtype('t,'a,'accum)foldi='t->init:'accum->f:(int->'accum->'a->'accum)->'accumtype('t,'a)iteri='t->f:(int->'a->unit)->unitmoduletypeS0=sigincludeContainer.S0(** These are all like their equivalents in [Container] except that an index starting at
0 is added as the first argument to [f]. *)valfoldi:(t,elt,_)foldivaliteri:(t,elt)iterivalexistsi:t->f:(int->elt->bool)->boolvalfor_alli:t->f:(int->elt->bool)->boolvalcounti:t->f:(int->elt->bool)->intvalfindi:t->f:(int->elt->bool)->(int*elt)optionvalfind_mapi:t->f:(int->elt->'aoption)->'aoptionendmoduletypeS1=sigincludeContainer.S1(** These are all like their equivalents in [Container] except that an index starting at
0 is added as the first argument to [f]. *)valfoldi:('at,'a,_)foldivaliteri:('at,'a)iterivalexistsi:'at->f:(int->'a->bool)->boolvalfor_alli:'at->f:(int->'a->bool)->boolvalcounti:'at->f:(int->'a->bool)->intvalfindi:'at->f:(int->'a->bool)->(int*'a)optionvalfind_mapi:'at->f:(int->'a->'boption)->'boptionendmoduletypeGeneric=sigincludeContainer.Generic(** These are all like their equivalents in [Container] except that an index starting at
0 is added as the first argument to [f]. *)valfoldi:('at,'aelt,_)foldivaliteri:('at,'aelt)iterivalexistsi:'at->f:(int->'aelt->bool)->boolvalfor_alli:'at->f:(int->'aelt->bool)->boolvalcounti:'at->f:(int->'aelt->bool)->intvalfindi:'at->f:(int->'aelt->bool)->(int*'aelt)optionvalfind_mapi:'at->f:(int->'aelt->'boption)->'boptionendmoduletypeMake_gen_arg=sigincludeContainer_intf.Make_gen_argvaliteri:[`Define_using_fold|`Customof('at,'aelt)iteri]valfoldi:[`Define_using_fold|`Customof('at,'aelt,_)foldi]endmoduletypeMake_arg=Make_gen_argwithtype'aelt:='aMonad.Ident.tmoduletypeMake0_arg=sigincludeContainer_intf.Make0_argincludeMake_gen_argwithtype'at:=tandtype'aelt:=Elt.tendmoduletypeIndexed_container=sig(** Provides generic signatures for containers that support indexed iteration ([iteri],
[foldi], ...). In principle, any container that has [iter] can also implement [iteri],
but the idea is that [Indexed_container_intf] should be included only for containers
that have a meaningful underlying ordering. *)moduletypeGeneric=GenericmoduletypeS0=S0moduletypeS1=S1(** Generic definitions of [foldi] and [iteri] in terms of [fold].
E.g., [iteri ~fold t ~f = ignore (fold t ~init:0 ~f:(fun i x -> f i x; i + 1))]. *)valfoldi:fold:('t,'a,'accum)fold->('t,'a,'accum)foldivaliteri:fold:('t,'a,int)fold->('t,'a)iteri(** Generic definitions of indexed container operations in terms of [foldi]. *)valcounti:foldi:('t,'a,int)foldi->'t->f:(int->'a->bool)->int(** Generic definitions of indexed container operations in terms of [iteri]. *)valexistsi:iteri:('t,'a)iteri->'t->f:(int->'a->bool)->boolvalfor_alli:iteri:('t,'a)iteri->'t->f:(int->'a->bool)->boolvalfindi:iteri:('t,'a)iteri->'t->f:(int->'a->bool)->(int*'a)optionvalfind_mapi:iteri:('t,'a)iteri->'t->f:(int->'a->'boption)->'boptionmoduleMake(T:Make_arg):S1withtype'at:='aT.tmoduleMake0(T:Make0_arg):S0withtypet:=T.tandtypeelt:=T.Elt.tmoduleMake_gen(T:Make_gen_arg):Genericwithtype'at:='aT.tandtype'aelt:='aT.eltend