I want to export a function from a custom module that uses some package inside itself, but it works in a unexpected way for me
module A
export f
using StatsBase
f(x) = StatsBase.sample([x,0])
end
using .A
f(1)
Output
UndefVarError: StatsBase not defined
Stacktrace:
[1] fff(::Int64) at ./In[1]:3
[2] top-level scope at In[7]:2
[3] include_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1091