Подкупило то, что “I've tried to, ahem, match the TC39 spec as closely as I could in anticipation of the hopeful day when I don't need to use it anymore”.
foo(match(val)
(
when(i => i == 0, 'none'),
when(i => i > 0, 'up'),
when(i => i < 0, 'down')
));