Module Db

module Entry : sig ... end
module Storage : sig ... end
module Type_polarity : sig ... end

This module provide a way to transform a type into strings, in such a way that the strings can be used for type search.

module Typexpr : sig ... end
module Occurences = Storage.Occurences
module String_automata : sig ... end
type t = Storage.db = {
  1. db_names : String_automata.t;
  2. db_pos_types : String_automata.t Occurences.t;
  3. db_neg_types : String_automata.t Occurences.t;
}

The type of a search database.

db_names is for text-based part of the query and db_types for the type-based part.

db_types has Entry.t array Int_map.t (Occ.t) as a payload because we want the query blabla : int -> int -> _ to return only entries that take at least two ints as arguments, an entry of type int -> string is invalid. The Int_map.t maps a number of occurences to a set of entries. See Occurences. db_types still is a suffix tree, so you can search in it only for text. The way we transform types into searchable text is in Type_polarity.