Skip to content

Replace (ptext .. sLit) with `text`

Sylvain Henry requested to merge hsyl20/ghc:hsyl20/perf/ptext into master
Replace (ptext .. sLit) with `text`

1. `text` is as efficient as `ptext . sLit` thanks to the rewrite rules

2. `text` is visually nicer than `ptext . sLit`

3. `ptext . sLit` encourages using one `ptext` for several `sLit` as in:

    ptext $ case xy of
      ... -> sLit ...
      ... -> sLit ...

  which may allocate SDoc's TextBeside constructors at runtime instead
  of sharing them into CAFs.

Merge request reports