mirror of
https://github.com/tweag/ormolu.git
synced 2024-10-05 17:37:11 +03:00
39db791bf3
Main occurrence is the operator tree code. This commit changes OpBranches [OpTree ty op] [op] to OpBranches (NonEmpty (OpTree ty op)) [op] such that the calls to `head`/`tail`/`last` can then be replaced by pattern matching on `:|` or by using the total replacements from `Data.List.NonEmpty`. Still, we need to call `NE.fromList` twice. `OverloadedLists` is only used in the tests; as it is otherwise too easy to accidentally write `[] :: NonEmpty a` without any warning. Alternatives to this commit are: - Just do the absolute minimal changes required to silence the warnings (ie basically inline `head`/`tail`). - Rewrite the operator tree code even further (maybe using more precise types) such that the `NE.fromList` are not necessary anymore. |
||
---|---|---|
.. | ||
Ormolu | ||
Spec.hs |