Reordering Arguments in `$match` for Cleaner Pattern Matching Syntax
Is there a way to make
Right now, the syntax is:
but I was hoping the data being matched could appear before the body as with pattern matching constructs in other languages:
or even in flipped "curried" form:
I find that assigning the result of
$match have the data being matched as its first argument?Right now, the syntax is:
but I was hoping the data being matched could appear before the body as with pattern matching constructs in other languages:
or even in flipped "curried" form:
I find that assigning the result of
$match to a variable unnecessarily pollutes the namespace if it's used just once (which I assume is much more often than not) which is what led me to the above code.