isTwo = \bytes ->
when bytes is
['\n', '\n', .. as rest] -> Bool.true
[a, .. as rest] if a == 'h' -> isTwo rest
[_, .. as rest] -> isTwo rest
[] -> Bool.false
expect isTwo ['\n'] |> Bool.not
This code causes a compiler crash for me:
thread 'main' panicked at 'Expected symbol `17.IdentId(5)` to be in environment', crates/compiler/mono/src/inc_dec.rs:293:21
Thought I'd better put it here for those who come after me. It seems like it's an issue with having the if
case and the case that destructures two items from the list
I think that might be the same as this bug:
https://github.com/roc-lang/roc/issues/6606
Ahh, well spotted, that does look like it
Last updated: Jul 05 2025 at 12:14 UTC