Export function-like objects

Hi,
in a custom module I’m defining function-like objects like this:

export trf_standardize

struct trf_standardize
    means
    stds
end

function (t::trf_standardize)(x)
    (x .- t.means) ./ (t.stds)
end

How would I export the function-like object?

No need to do anything – exporting the type exports the functor as well.

2 Likes

By the way, it’s a fairly strong Julia convention to spell types with PascalCase.

I know, but I prefer snake case.

Thanks @mbaz

1 Like