Closed denis-ok closed 2 months ago
This has been considered a feature of Reason since the start, but personally it's always annoyed me.
I'm sure some folks depend on it, though, so not sure what to do about it.
there's some discussion in https://github.com/reasonml/reason/issues/1700
let's follow this in #1700
When pattern-matching boolean values, it's common to match the
true
value first. However, this approach can lead to undesirable formatting behavior. For instance:This:
Formats to:
Sometimes a code style when we first match a shorter branch (with less code) is preferred. To prevent automatic formatting to a ternary expression in such cases we have to match
false
as a wildcard_false
.