roc
roc copied to clipboard
does std lib support multi-line List definitions?
I get the following error when trying to compile the below code. I assume this is because you cannot define a list that extends over multiple lines.
── UNFINISHED LIST ────────────────────────────────────── multi-line-lists.roc ─
I cannot find the end of this list:
17│ expect List.len [
^
You could change it to something like [1, 2, 3] or even just [].
Anything where there is an open and a close square bracket, and where
the elements of the list are separated by commas.
Note: I may be confused by indentation%
app "aoc-2021-day-3"
packages { pf: "cli-platform/main.roc" }
imports [
pf.Program.{ Program },
pf.Stdout,
pf.Task.{ Task },
pf.File,
pf.Path.{ Path },
]
provides [main] to pf
main : Program
main =
Stdout.line "Something helpful"
|> Program.quick
expect List.len [
[0,0,1,0,0],
[1,1,1,1,0],
[1,0,1,1,0],
[1,0,1,1,1],
[1,0,1,0,1],
[0,1,1,1,1],
[0,0,1,1,1],
[1,1,1,0,0],
[1,0,0,0,0],
[1,1,0,0,1],
[0,0,0,1,0],
[0,1,0,1,0]
] == 12
Yes, but this must be a parse error
Resolved. Indenting fixes this issue.