How to check if a module exists? How to check if a module has a function?

Do you want to test if the module is loaded and exports a specific function, or you do you want to test if there exists a module which you can reach at all containing the function? If it is the first then you have the function :erlang.function_exported(module, function, arity). I don’t know if there is an Elixir interface function. The other alternative has already been covered here, but be aware that the solutions, when they check, will load the module if it not already loaded.

6 Likes