3 ms·
One of Haskell's most popular formatters, Formolu [1], is explicitly not opinionated and has custom whitespace as a goal: > Let some whitespace be programmable
by armchairhacker 4y ago
One of Haskell's most popular formatters, Formolu [1], is explicitly not opinionated and has custom whitespace as a goal:
> Let some whitespace be programmable. The layout of the input influences the layout choices in the output. This means that the choices between single-line/multi-line layouts in certain situations are made by the user, not by an algorithm. This makes the implementation simpler and leaves some control to the user while still guaranteeing that the formatted code is stylistically consistent.
Coq, Agda, etc. also don't have formatters either, partly because "user-defined layout", but also partly because their syntax is just so complicated and they have smaller ecosystems
[1] https://hackage.haskell.org/package/fourmolu https://hackage.haskell.org/package/fourmolu