on master help sign in
Update analysis for contributions. (#14)
ef1c8d3Facundo Domínguez
DESIGN.md+5−11
@@ -336,13 +336,6 @@ Crucially, no effort is made to fit within reasonable line lengths. That's
336up to the programmer. Style will still be consistent for everyone in every
336up to the programmer. Style will still be consistent for everyone in every
337other aspect, and that's what counts.
337other aspect, and that's what counts.
338
338
339−Not having to worry about line lengths is a huge simplification. Worrying
340−about them is why Hindent can run in time exponential to the size of the
341−input: it tries two variants at each node of the CST, to see whether one of
342−them fits on one 80-character line (and selects that one if so). If your CST
343−is even just somewhat deep, then you’re going to be waiting on your
344−formatter for a while.
345−
346### Configuration
339### Configuration
347
340
348There should be some configuration but at this point I'll leave this section
341There should be some configuration but at this point I'll leave this section
@@ -410,11 +403,12 @@ We want to simultaneously optimize three goals:
4102. efficiency,
4032. efficiency,
4113. predictable and readable output that doesn't overuse vertical spacing.
4043. predictable and readable output that doesn't overuse vertical spacing.
412
405
406+Hindent aims for (1) and (2) by still producing something palatable in (3).
413−Hindent optimizes for (1) and gives up on (2) and (3). Brittany gives up on
407+Brittany gives up on
414(1) but goes a long way towards (3) and presumably does OK on (2). Ormolu
408(1) but goes a long way towards (3) and presumably does OK on (2). Ormolu
415−goes for (1)-(3), by outsourcing the hard part of (3) to the user. Ormolu is
409+goes for (1), (2) and (3), by outsourcing the hard part of (3) to the user.
416−less normative than Brittany, and less normative than Hindent, but arguably
410+Ormolu is less normative than Brittany, and less normative than Hindent,
417−stills achieves consistent style.
411+but arguably stills achieves consistent style.
418
412
419Forking or contributing to Hindent is not an option because if we replace
413Forking or contributing to Hindent is not an option because if we replace
420`haskell-src-exts` with `ghc` (or `ghc-exact-print`) then we'll have to work
414`haskell-src-exts` with `ghc` (or `ghc-exact-print`) then we'll have to work