Something like Ok('a' <= l <= 'z') ->
I think in the old compiler you could do something like:
match item {
Ok(x) if x < 2 => Foo
Ok(x) if x < 4 => Bar
_ => Baz
}
See https://roc-lang.org/tutorial#pattern-matching (old syntax was when item is ...). But I don't think this is implemented in the new compiler yet.
If 'a' <= l <= 'z' will be possible or if it has to be 'a' <= l and l <= 'z', I'm not sure. But I personally don't like this shortcut and prefer the long version anyway.
I've brought something similar up once at #ideas > chained comparison operators for boolean operators. tldr is that it's not going to happen.
Last updated: Jun 16 2026 at 16:19 UTC