I don’t think this does create an improper list. It’s a recursive function, and that function has termination clauses that return [], which means it’ll construct a proper list.
As to this:
I think it’s better to approach this by understanding that the cons operator | is, at least in erlang, more foundational than even lists. Its most common use is with lists, but it has uses for low memory btrees, and gets use in IOlists as well.






















