   @moduledoc false
 
   import IEx, only: [dont_display_result: 0]
+
+  alias Kernel.Typespec
 
   @doc """
   Prints the documentation for the given module.

  Prints the types for the given module.
  """
  def t(module) when is_atom(module) do
    _ = case Kernel.Typespec.beam_types(module) do
      nil   -> nobeam(module)
      []    -> notypes(inspect module)
      types -> for type <- types, do: print_type(type)


  defp print_callback_doc({{fun, _}, _line, kind, doc}, spec) do
    definition =
      Typespec.spec_to_ast(fun, spec)
      |> Macro.to_string

    print_doc("#{kind}callback #{definition}", doc || "")
