Skip to content

Instantly share code, notes, and snippets.

@katafrakt
Created May 10, 2023 10:17
Show Gist options
  • Save katafrakt/d4817b97c357ea9ff297f94ad938ec5f to your computer and use it in GitHub Desktop.
Save katafrakt/d4817b97c357ea9ff297f94ad938ec5f to your computer and use it in GitHub Desktop.
defmodule IexHelpers do
def search_fn(name) do
:code.all_loaded()
|> Enum.filter(fn {mod, _} -> "#{mod}" =~ ~r{^[A-Z]} end)
|> Enum.map(fn {mod, _} -> mod end)
|> Enum.each(fn mod ->
mod.__info__(:functions)
|> Enum.each(fn {fun_name, arity} ->
if fun_name == name do
IO.puts "#{mod}.#{fun_name}/#{arity}"
end
end)
end)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment