ku-fpg/blank-canvas — pull request #53 by RyanGlScott (2014-12-08 03:08:20+00:00)
Title: Replace String with Text internally

My attempt to resolve #17 (part two). This addresses the shortcoming of the previous pull request (#50); namely, this pull request automatically derives text `Show` instances for `TextMetrics` and other data types.

As noted in the [changelog](https://github.com/RyanGlScott/blank-canvas/blob/5dfdcd5f07796e82bb830bdd1da234275425a0f6/Changelog.md), there were two breaking API changes:

* `showJS` was renamed to `showbJS`, since it now returns a text `Builder`. The name change was made to stick with the conventions I started in [`text-show`](https://github.com/RyanGlScott/text-show).
* `jsStyle` now returns a `Builder` as well.

Some caveats:

* Just like in #50, I had to change `Graphics.Blank.Generated` to accommodate text `Builder`s, so the Perl script for auto-generating that module probably doesn't work anymore, and I'm too scared of Perl to try and fix it.
* In the process of creating this pull request, I discovered what appears to be [a bug in Template Haskell](https://ghc.haskell.org/trac/ghc/ticket/9871) in which TH-spliced `instance` declarations cause subsequent identifiers in the module to fall out of scope if placed in certain parts of the source code. For now, a workaround is to place `$(deriveShow ''TextMetrics)` and other TH functionality at the very end of modules.