Created
May 10, 2023 10:17
-
-
Save katafrakt/d4817b97c357ea9ff297f94ad938ec5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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