Let’s look at built-in IEx helpers which print docs about module, method, introspect data, type(s), reuse shell results.
In short - make our work efficient.
🍳 Recipe 2: The h
, i
, t
, v
helpers
The secret spice blend of IEx.
iex> h IExHelpers
# prints the doc
iex> some = "TEST"
iex> i some
# full introspection
iex> t Enum
# view the types defined
iex> v()
# see the value of the last
iex>v N
# or previous results (N is number of line, check screenshot)
💡 Pro Tip: since v()
returns previous result - You can run reuse it
iex(1)> ["iex_helpers.ex", ".iex.exs", "screenshots"]
iex(2)>
nil
iex(3)>
nil
iex(4)> files = v(1)
["iex_helpers.ex", ".iex.exs", "screenshots"]
iex(5)> files |> Enum.each(& IO.puts("File: " <> &1))