 
   @doc false
   def s(module, function) when is_atom(function) do
-    specs = lc {{f, _arity}, _spec} = spec inlist Kernel.Typespec.beam_specs(module),
+    specs = lc {{f, _arity}, _spec} = spec inlist beam_specs(module),
                f == function do
       print_spec(spec)
       spec

  end

  def s(module, []) do
    specs = lc spec inlist Kernel.Typespec.beam_specs(module), do: print_spec(spec)

    if specs == [] do
      IO.puts "No specs for #{inspect module} have been found"

    :ok
  end

  defp beam_specs(module) do
    specs = Enum.map(Kernel.Typespec.beam_specs(module), {:spec, &1})
    callbacks = Enum.map(Kernel.Typespec.beam_callbacks(module), {:callback, &1})
    List.concat(specs, callbacks)
  end

  defp print_type({ kind, type }) do
    ast = Kernel.Typespec.type_to_ast(type)
    IO.puts "@#{kind} #{Macro.to_binary(ast)}"
    true
  end

  defp print_spec({kind, { { name, _arity }, specs }}) do
    Enum.each specs, fn(spec) ->
      binary = Macro.to_binary Kernel.Typespec.spec_to_ast(name, spec)
      IO.puts "@#{kind} #{binary}"
    end
    true
  end
