Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file keychainable_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132(** Implements chains of sequential key, used as indices into a trie. *)open!Base(** The interface to a keychain type. *)moduletypeS=sig(** The type of a keychain implementation. See [Keychainable.t] below. *)type('chain,'desc)keychainableconstraint'desc=_*_*_*_*_(** Keychain elements are usable as keys into ordered collections. *)moduleKey:Comparator.S(** Keychains support iteration over each key in the chain. *)moduleIterator:Iterator.S0withtypeelt=Key.t(** The type of a keychain. *)typet=Iterator.seq(** A phantom type identifying the keychainable implementation. *)typekeychain_witness(** A compound type used in the [Keychainable.t] argument normally hidden by a GADT. *)typekeychain_description=keychain_witness*Key.t*Key.comparator_witness*Iterator.t*Iterator.iterator_witness(** The implementation of the keychain type. *)valkeychainable:(t,keychain_description)keychainableend(** The implementation of a keychain type. *)moduletypeImpl=sigtypekeychain_witness(** Keychain elements must be usable as keys into ordered collections. *)moduleKey:Comparator.S(** Represents a keychain containing [Key.t] elements. *)typet[@@derivingsexp_of](** Implements iteration over the keys of a keychain. *)moduleIterator:Iterator.S0withtypeseq=tandtypeelt=Key.t(** Constructs a keychain from keys. Proceeds in reverse order because it is most often
applied to accumulators that are built up as stacks. *)valof_rev_keys:Key.tlist->tend(** Used to implement keychains via conversion to and from lists. *)moduletypeListable=sigtypeelttypet[@@derivingsexp_of]valto_list:t->eltlistvalof_list:eltlist->tendmoduletypeKeychainable=sigmoduletypeImpl=ImplmoduletypeListable=Listable(** A first-class module implementing a keychain type, wrapped in a GADT to combine
several type parameters that are irrelevant to most users.
This type is [private] so that users can only construct it via [Make] and other
related functors below. *)type('chain,'desc)t=private(moduleImplwithtypet='chainandtypeKey.t='keyandtypeKey.comparator_witness='cmpandtypeIterator.t='iterandtypeIterator.iterator_witness='idxandtypekeychain_witness='wit)constraint'desc='wit*'key*'cmp*'iter*'idxmoduletypeS=Swithtype('chain,'desc)keychainable:=('chain,'desc)t(** Accessors into an implementation. *)valsexp_of_keychain:('chain,_)t->'chain->Sexp.tvalsexp_of_key:(_,_*'key*_*_*_)t->'key->Sexp.tvalkeychain_of_rev_keys:('chain,_*'key*_*_*_)t->'keylist->'chainvalcomparator:(_,_*'key*'cmp*_*_)t->('key,'cmp)Comparator.tvalcomparator_m:(_,_*'key*'cmp*_*_)t->(moduleComparator.Swithtypet='keyandtypecomparator_witness='cmp)valiterator:('chain,_*'key*_*'iter*'idx)t->('iter,'chain,'key,'idx)Iterator.tvaliterator_m:('chain,_*'key*_*'iter*'idx)t->(moduleIterator.S0withtypet='iterandtypeseq='chainandtypeelt='keyandtypeiterator_witness='idx)valstart:('chain,_*_*_*'iter*_)t->'chain->'itervalis_finished:('chain,_*_*_*'iter*_)t->'iter->'chain->boolvalget_exn:('chain,_*'key*_*'iter*_)t->'iter->'chain->'keyvalnext_exn:('chain,_*_*_*'iter*_)t->'iter->'chain->'iter(** Functors and modules implementing keychains. *)moduleMake(Impl:Impl):SwithmoduleKey=Impl.KeyandmoduleIterator=Impl.Iteratorandtypekeychain_witness=Impl.keychain_witnessmoduleOf_string:SwithtypeKey.t=charandtypeKey.comparator_witness=Char.comparator_witnessandmoduleIterator=Iterator.Of_stringmoduleOf_list(Key:Comparator.S):SwithmoduleKey=KeyandmoduleIterator=Iterator.Monomorphic(Iterator.Of_list)(Key)moduleOf_listable(Key:Comparator.S)(Keychain:Listablewithtypeelt=Key.t):SwithmoduleKey=KeyandmoduleIterator=Iterator.Of_listable0(Keychain)end