Is it possible to write an improper list in Gleam? #1018
-
An improper list is one where the tail of a list is not a list. This stack overflow answer explains it pretty well. I can't see how one could be made in Gleam. Yet it looks like the gleam source code supports it. Could anyone share an example of creating some Gleam source that produces a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
[1, 2, ..this_is_a_variable] All lists have to be proper for the type checker to be happy. Good use of the questions section! I like this a lot! |
Beta Was this translation helpful? Give feedback.
NotList
here means a variable or something. A more descriptive name might beNotALiteralList
, but it will still be a list at runtime as the type checker as passed.All lists have to be proper for the type checker to be happy.
Good use of the questions section! I like this a lot!