Inconsistent formatting of callback params in v10 beta
v10 beta formats as follows, note the inconsistency in the location of (a, b):
do(() =>
receivedMessages->SortArray.stableSortBy((a, b) =>
DateUtils.compareDatesAsc(a.published, b.published)
)
)
// With more nesting, the params (a, b) jump to the next line
do(() =>
do(() =>
receivedMessages->SortArray.stableSortBy(
(a, b) => DateUtils.compareDatesAsc(a.published, b.published),
)
)
)
whereas 9.1.4 formatted this consistently:
do(() =>
receivedMessages->SortArray.stableSortBy((a, b) =>
DateUtils.compareDatesAsc(a.published, b.published)
)
)
do(() =>
do(() =>
receivedMessages->SortArray.stableSortBy((a, b) =>
DateUtils.compareDatesAsc(a.published, b.published)
)
)
)
This must be a side effect of the changes made to avoid "exponential explosion". If possible, it would be great if we could avoid exponential explosion and still keep the location of (a, b) consistent.
Neither is consistent not inconsistent. They are different.
The former follows an algorithm that always breaks the parent when the child does.
The question is which one is more desirable, and why.
I wonder if we could simplify everything by taking hints from the input.
The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.