
  -spec erlang:fun_info(Fun) -> [{Item, Info}]
                           when
                               Fun :: function(),
                               Item ::
                                   arity | env | index | name | module |
                                   new_index | new_uniq | pid | type |
                                   uniq,
                               Info :: term().

  Returns a list with information about the fun Fun. Each list
  element is a tuple. The order of the tuples is undefined, and more
  tuples can be added in a future release.

  Warning:
    This BIF is mainly intended for debugging, but it can
    sometimes be useful in library functions that need to verify,
    for example, the arity of a fun.

  Two types of funs have slightly different semantics:

   • A fun created by fun M:F/A is called an external fun.
     Calling it will always call the function F with arity A
     in the latest code for module M. Notice that module M
     does not even need to be loaded when the fun fun M:F/A is
     created.

   • All other funs are called local. When a local fun is
     called, the same version of the code that created the fun is
     called (even if a newer version of the module has been
     loaded).

  The following elements are always present in the list for both
  local and external funs:

  {type, Type}:
    Type is local or external.

  {module, Module}:
    Module (an atom) is the module name.

    If Fun is a local fun, Module is the module in which the
    fun is defined.

    If Fun is an external fun, Module is the module that the
    fun refers to.

  {name, Name}:
    Name (an atom) is a function name.

    If Fun is a local fun, Name is the name of the local
    function that implements the fun. (This name was generated by
    the compiler, and is only of informational use. As it is a
    local function, it cannot be called directly.) If no code is
    currently loaded for the fun, [] is returned instead of an
    atom.

    If Fun is an external fun, Name is the name of the
    exported function that the fun refers to.

  {arity, Arity}:
    Arity is the number of arguments that the fun is to be called
    with.

  {env, Env}:
    Env (a list) is the environment or free variables for the
    fun. For external funs, the returned list is always empty.

  The following elements are only present in the list if Fun is
  local:

  {pid, Pid}:
    Pid is the process identifier of the process that originally
    created the fun.

    It might point to the init process if the Fun was
    statically allocated when module was loaded (this optimisation
    is performed for local functions that do not capture the
    environment).

  {index, Index}:
    Index (an integer) is an index into the module fun table.

  {new_index, Index}:
    Index (an integer) is an index into the module fun table.

  {new_uniq, Uniq}:
    Uniq (a binary) is a unique value for this fun. It is
    calculated from the compiled code for the entire module.

  {uniq, Uniq}:
    Uniq (an integer) is a unique value for this fun. As from
    Erlang/OTP R15, this integer is calculated from the compiled
    code for the entire module. Before Erlang/OTP R15, this
    integer was based on only the body of the fun.
