def inits
      raise Erlang::ImproperListError if improper?
      return self if empty?
      prev = nil
      return map do |head|
        if prev.nil?
          Erlang::List.from_enum(prev = [head])
        else
          Erlang::List.from_enum(prev.push(head))
        end
      end
    end
def inits
      raise Erlang::ImproperListError if improper?
      return self if empty?
      prev = nil
      return map do |head|
        if prev.nil?
          Erlang::List.from_enum(prev = [head])
        else
          Erlang::List.from_enum(prev.push(head))
        end
      end
    end
Return a `List` of all prefixes of this list.

 @example
   Erlang::List[1,2,3].inits
   # => Erlang::List[
   #      Erlang::List[1],
   #      Erlang::List[1, 2],
   #      Erlang::List[1, 2, 3]]

 @return [List]