What are your thoughts on supporting nested list prepends?
Example:
[1 | 2 | [3,4]]
Current equivalence:
[1 | [2 | [3,4]]]
I would be in favour of this addition.
What's the Erlang syntax for this? In my head it's [1, 2 | List]
I'm not very familiar with Erlang. In Haskell it is:
Prelude> 1:2:[3,4]
[1,2,3,4]
Seems my memory is correct and its [1, 2 | [3]] in both Erlang and Elixir. Let's use the same syntax as them for this.
I would suggest we alter the AST for cons to have a vector of elements for the head to support this:
https://github.com/lpil/gleam/blob/ace1a6db1c73005a29c2913ae9a0e6f4bc1f35bf/gleam/src/ast.rs#L234
https://github.com/lpil/gleam/blob/ace1a6db1c73005a29c2913ae9a0e6f4bc1f35bf/gleam/src/ast.rs#L398
Most helpful comment
Seems my memory is correct and its
[1, 2 | [3]]in both Erlang and Elixir. Let's use the same syntax as them for this.I would suggest we alter the AST for cons to have a vector of elements for the head to support this:
https://github.com/lpil/gleam/blob/ace1a6db1c73005a29c2913ae9a0e6f4bc1f35bf/gleam/src/ast.rs#L234
https://github.com/lpil/gleam/blob/ace1a6db1c73005a29c2913ae9a0e6f4bc1f35bf/gleam/src/ast.rs#L398