Drup / dowsing

᚛ A type of divination employed in attempts to locate identifiers matching a given type expression
ISC License
35 stars 4 forks source link

Filter out modules with double underscores #13

Closed kit-ty-kate closed 3 months ago

kit-ty-kate commented 2 years ago

Given most libraries nowadays use dune and are packed, every functions will be technically available twice:

e.g.

$ dowsindex search "string -> string -> string" | grep "Js_of_ocaml_compiler"
Js_of_ocaml_compiler.Stdlib.String.cat : string -> string -> string
Js_of_ocaml_compiler__Stdlib.String.cat : string -> string -> string
Js_of_ocaml_compiler.Stdlib.Filename.concat : string -> string -> string
Js_of_ocaml_compiler__Stdlib.Filename.concat : string -> string -> string
Js_of_ocaml_compiler.Stdlib.Filename.chop_suffix : string -> string -> string
Js_of_ocaml_compiler__Stdlib.Filename.chop_suffix :

Realistically only the second one is ever used so it would be very handy to detect duplicates and only show the wrapped modules. (an optional argument can be available for users who want the unfiltered output)

Drup commented 2 years ago

__ are currently ordered later, but not hidden. I'm rather squeamish about hiding them completely.

What I would like is rather to have a complete mapping of redefinition/aliases so that we can avoid the problem completely. This requires quite a bit more for the underlying tooling.

Drup commented 3 months ago

Last version uses odoc, which filters things for us !