I'm trying to write something similar to this Elm code:
case myList of
[] ->
...
[ theOnlyItem ] ->
...
items ->
...
Is it possible to destructure lists like this?
Not currently. There has been discussion a few times around this
I think it is likely to be added eventually, but not definite.
Ah shame. I really hope we end up with something like this. Thanks for the quick reply
I think we may already have an issue for this but I couldn't find it now.
Here's the issue you were looking for:
https://github.com/roc-lang/roc/issues/4171
Thanks @Chris Duncan :)
Last updated: Jul 05 2025 at 12:14 UTC