About the | operator in erlang.
erlang
Solution
This is called an improper list and should typically not be used. I think most library functions expects proper lists (e.g. length([1|2]) throws bad argument exception). Pattern matching with improper lists works though.
For some use cases, see Practical use of improper lists in Erlang (perhaps all functional languages)
Problem
We can make a nested list in erlang by writing something like this: ``` NL = [[2,3], [1]]. [[2,3],[1]] ``` But assume we wrote it like this instead: ``` OL = [[2,3]|1]. [[2,3]|1] ``` Is OL still a list? Can someone please elaborate more what OL is?