Skip to content

Commit

Permalink
Improve IEX's s helper implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Dec 2, 2012
1 parent 295d275 commit 0f9b717
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/iex/lib/iex/helpers.ex
Expand Up @@ -369,18 +369,14 @@ defmodule IEx.Helpers do


@doc false @doc false
def s(module, function, arity) do def s(module, function, arity) do
case Enum.filter(beam_specs(module), specs = lc {_kind, {{f, a}, _spec}} = spec inlist beam_specs(module),
fn({_type, {{f,a}, _value}}) -> f == function and a == arity do
f == function and a == arity print_spec(spec)
end) do spec
[spec] -> :ok
_ -> spec = nil
end end


if spec do if specs == [] do
print_spec(spec) IO.puts "No specs for #{inspect module}.#{function} have been found"
else
IO.puts "No specs for #{inspect module}.#{function}/#{arity} have been found"
end end


:ok :ok
Expand Down

0 comments on commit 0f9b717

Please sign in to comment.