Changelog History
Page 1
-
v3.0 Changes
May 28, 1987๐ Cured massive performance bug. If you write:
foldl <> empty (map (text.show) [1..10000])
You get quadratic behaviour with V2.0. Why? For just the same reason as you get quadratic behaviour with left-associated (++) chains.
This is really bad news. One thing a pretty-printer abstraction should certainly guarantee is insensitivity to associativity. It matters: suddenly GHC's compilation times went up by a factor of 100 when I switched to the new pretty printer.
I fixed it with a bit of a hack (because I wanted to get GHC back on the road). I added two new constructors to the Doc type, Above and Beside:
<> = Beside $$ = Above
Then, where I need to get to a "TextBeside" or "NilAbove" form I "force" the Doc to squeeze out these suspended calls to Beside and Above; but in so doing I re-associate. It's quite simple, but I'm not satisfied that I've done the best possible job. I'll send you the code if you are interested.
โ Added new exports: punctuate, hang int, integer, float, double, rational, lparen, rparen, lbrack, rbrack, lbrace, rbrace,
fullRender's type signature has changed. Rather than producing a string it now takes an extra couple of arguments that tells it how to glue fragments of output together:
fullRender :: Mode -> Int -- Line length -> Float -- Ribbons per line -> (TextDetails -> a -> a) -- What to do with text -> a -- What to do at the end -> Doc -> a -- Result
The "fragments" are encapsulated in the TextDetails data type:
data TextDetails = Chr Char | Str String | PStr FAST_STRING
The Chr and Str constructors are obvious enough. The PStr constructor has a packed string (FAST_STRING) inside it. It's generated by using the new "ptext" export.
An advantage of this new setup is that you can get the renderer to do output directly (by passing in a function of type (TextDetails -> IO () -> IO ()), rather than producing a string that you then print.
-
v1.1.3.6 Changes
January 30, 2018- ๐ Fix compatability with GHC-8.4/base-4.11 (by Herbert Valerio Riedel).
- โ Add in benchmarking framework (by Alfredo Di Napoli).
-
v1.1.3.5 Changes
February 01, 2017- ๐ Fix documentation formatting bug (by Ivan Lazar Miljenovic)
- ๐ Fix missing git tag on Github for v1.1.3.4 release.
-
v1.1.3.4 Changes
June 03, 2016- ๐ Fix over-zeleaous use of strictness causing stack allocation, fixes part of issue #32 (by Neil Mitchell).
-
v1.1.3.3 Changes
February 29, 2016- ๐ Improve documentation.
-
v1.1.3.2 Changes
March 19, 2015- ๐ Fix bug with haddock documentation.
- ๐ Clean up module intro documentation.
-
v1.1.3.1 Changes
March 11, 2015- โ Add support for annotations in pretty (by Trevor Elliott).
-
v1.1.2.1 Changes
December 25, 2014- ๐ Fix overly-strict issue preventing use of pretty for very large docs (by Eyal Lotem).
-
v1.1.2.0 Changes
December 25, 2014- ๐ฆ Merge in prettyclass package -- new Text.PrettyPrint.HughesPHClass.
- โ Add in 'maybe*' variants of various bracket functins.
- โ Add Generic instances for appropriate data types.
- ๐ Fix compilation under GHC 7.10
-
v1.1.1.3 Changes
December 21, 2014- โ Remove upper bound on
deepseq
package to fix build issues with latest GHC.
- โ Remove upper bound on