Uh oh!
There was an error while loading. Please reload this page.
group: Add shortcut for previously grouped documents - #123
Conversation
sjakobi
commented
Jan 22, 2020
This doesn't seem to speed up my |
sjakobi
commented
Jan 23, 2020
I noticed that this shortcut only works for documents that, in a previous This makes me wonder whether we should wrap the result of the Maybe this would be a useless optimization though – benchmarking necessary! We should probably also document that |
sjakobi
commented
Jan 24, 2020
I gave this a try: --- a/prettyprinter/src/Data/Text/Prettyprint/Doc/Internal.hs+++ b/prettyprinter/src/Data/Text/Prettyprint/Doc/Internal.hs@@ -527,8 +527,8 @@ group x = case x of
Union{} -> x
_ -> case changesUponFlattening x of
Flattened x' -> Union x' x
- AlreadyFlat -> x- NeverFlat -> x+ AlreadyFlat -> Union Fail x+ NeverFlat -> Union Fail x
-- Note [Group: special flattening]
--
|
This results in a significant speedup in the usual dhall benchmark. Includes #123.
sjakobi
commented
Feb 2, 2020
Superseded by #140. |
Fixes#120.