Suppose I have a list and I want to cons two elements to it. I could do this:
list = [3,4]
[1,2,3,4] == [ 1 | [2 | list ] ]
This is ugly and doesn’t extend to n elements.
What idiom supports this?
>Solution :
Multiple head elements can be added comma-separated.
list = [3, 4]
[1, 2, 3, 4] == [1, 2 | list]
#⇒ [1, 2, 3, 4]