agda-stdlib
agda-stdlib copied to clipboard
Improvements for `Text.Pretty`
Currently http://agda.github.io/agda-stdlib/Text.Pretty.html suffers from various limitations:
-
Performance:
_<>_
only filters the invalid results, it does not discard the dominated ones. This doesn't prevent combinatorial explosion (we've been experiencing issues with this on my Haskell port of the Agda port in https://github.com/msp-strath/TypOs). Cf. the call tobestsOn
here in the original lib. -
Any result is better than no result: we do guarantee that the result will fit in the tapewidth... at the cost of never returning anything if no layout will fit! It would be better for the toplevel
Doc
to be a sum type of either aList1
of candidates that fit or a single document that does not fit. -
Support for annotations & configuration (it's all worked out in this
Doc.Internal
module and just needs porting)