PassiveSupport.Module (passive_support v0.8.3)
Convenience functions and helpers for module introspection
Link to this section Summary
Functions
For a module
and export
, returns either nil
or a tuple describing the export.
Link to this section Functions
Link to this function
check_for_export(module, export)
Specs
check_for_export(atom(), atom()) :: {:function | :macro, [non_neg_integer()]} | nil
For a module
and export
, returns either nil
or a tuple describing the export.
This function does not retrieve private function or macro arities, as its intended use case is for dynamically finding if a given function or macro can be called upon within a given module, and if so, with how many arguments.
## Examples
iex> check_for_export(String, :trim)
{:function, [1, 2]}
iex> check_for_export(PassiveSupport.Path.Sigil, :sigil_P)
{:macro, [2]}
iex> check_for_export(Integer, :possibly_private_but_equally_likely_not_to_exist)
nil