What about:

    Enum.reduce candidates, :not_found, fn
      mod, :ok -> :ok
      mod, _ -> h(mod, unquote(name))
    end