# \`help?\> X\` should suggest \`Base.X\` if \`X\` is an un-exported member of \`Base\`

**URL:** <https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539>\
**Category:** Internals & Design\
**Created:** [October 31, 2022, 4:13am UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539 "2022-10-31T04:13:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bert](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@bert](https://discourse.julialang.org/u/bert)\
**Post date:** [October 31, 2022, 4:13am UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/1 "2022-10-31T04:13:51Z")

</div>

I think it would be helpful if when searching `help?> X` for an object `X` that is defined in, but not exported from, `Base`, if the `help?> X` menu offered to show you the documentation of `Base.X` rather than just say `Couldn't find X`.

The specific example that inspired this:

```nohighlight
help?> Fix2
search: chopprefix chopsuffix findnext findmax! findmax TaskFailedException firstindex

Couldn't find Fix2
Perhaps you meant fill, if, diff, Pipe, Cint, Dict, Dims, Libc, Text, abs2, big or bind
  No documentation found.

  Binding Fix2 does not exist.

help?> Base.Fix2
  Fix2(f, x)

  A type representing a partially-applied version of the two-argument function f, with
  the second argument fixed to the value "x". In other words, Fix2(f, x) behaves
  similarly to y->f(y, x).

```

It would be nice if `help?> Fix2` suggested that I search for `Base.Fix2` or even offer to show it automatically (kind of like how the new `Pkg` offers to install a package you try to `using` that you don’t yet have installed).

---

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [October 31, 2022, 6:17am UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/2 "2022-10-31T06:17:24Z")

</div>

More generally, the “perhaps you meant” section could also list `Foo.X` if the user happens to have loaded a package `Foo`, which has an un-exported function `X`.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 31, 2022, 6:26am UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/3 "2022-10-31T06:26:29Z")

</div>

```julia
julia> apropos("Fix2")
Base.:>=
Base.:<
Base.in
Base.Fix2
Base.Fix1

```

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [October 31, 2022, 7:51am UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/4 "2022-10-31T07:51:16Z")

</div>

I would be annoyed if `?Fix2` worked but `Fix2` didn’t. `Perhaps you meant Base.Fix2` would be nice though.

---

<div class="post-metadata">

**Author:** ![bert](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@bert](https://discourse.julialang.org/u/bert)\
**Post date:** [November 2, 2022, 2:26pm UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/5 "2022-11-02T14:26:09Z")

</div>

This is a so-so solution. `apropos` is pretty slow, returns a lot of non-matches, and takes a while to return if the function you’re interested in has no documentation. I think the first call to `apropos` actually runs through and loads the docs for every function in the workspace, which is incredibly expensive.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [November 2, 2022, 4:05pm UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/6 "2022-11-02T16:05:04Z")

</div>

Does the speed depend on what you’re searching for? I see:

```julia
julia> @time apropos("Fix2")
Base.:!=
Base.Fix1
Base.Fix2
Base.startswith
Base.:>
Base.contains
Base.isequal
Base.:<
Base.endswith
Base.:==
Base.:<=
Base.:>=
Base.occursin
Base.in
  0.825711 seconds (2.44 M allocations: 160.969 MiB, 3.54% gc time, 77.51% compilation time)

```

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [November 2, 2022, 4:34pm UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/7 "2022-11-02T16:34:42Z")

</div>

In julia 1.8.2 on linux. Second call is faster.

```julia
julia> @time apropos("Fix2")
Base.:>
Base.occursin
Base.in
Base.:!=
Base.:<
Base.:>=
Base.startswith
Base.:<=
Base.endswith
Base.Fix2
Base.Fix1
Base.isequal
Base.contains
Base.:==
  8.814449 seconds (3.48 M allocations: 211.022 MiB, 6.51% gc time, 90.66% compilation time: 48% of which was recompilation)

```

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [November 2, 2022, 4:51pm UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/8 "2022-11-02T16:51:13Z")

</div>

Very odd - mine was in a new 1.8.2 session on Windows, seems unusual that Windows should be an order of magnitude faster? (This is getting a bit offtopic though, might warrant splitting the thread if there’s an issue with the speed of `apropos`)

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [November 2, 2022, 4:59pm UTC](https://discourse.julialang.org/t/help-x-should-suggest-base-x-if-x-is-an-un-exported-member-of-base/89539/9 "2022-11-02T16:59:16Z")

</div>

It would be nice if the helped search _in packages_, but possibly AVOIDING unexported from Base.

It does search exported from Base, and if **not** exported it’s not part of Julia’s API, so I’m not sure it _should_ be shown (possibly it’s helpful until it isn’t and dropped from Base, has happened before). Or IF then with a big warning. If you know of something there, which is documented AND useful for regular developers I think you should open an issue and get it exported. Maybe there’s a reason it isn’t.
