I don’t think there is an advantage in having this syntax in elm because we are forced to have an else branch to have total functions. It’s thus roughly the same than doing pattern matching. This is not the case in Rust where you can have early returns, where this syntax is mostly useful.
I think it would be strange to add syntax specifically to make it easier/nicer to do something that is generally discouraged.
This syntax is just a nicer way of doing:
greaterThanFive : Num -> Bool
greaterThanFive val =
case val of
Num n ->
n > 5
_ ->
False
But generally it’s discouraged to write functions that don’t handle all variants of a type. So it would be strange to have special syntax for such a rare case.