Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance
authorRyanGlScott <ryan.gl.scott@gmail.com>
Sun, 17 Jan 2016 18:28:10 +0000 (19:28 +0100)
committerBen Gamari <ben@smart-cactus.org>
Sun, 17 Jan 2016 22:40:42 +0000 (23:40 +0100)
commit65b810bdda625f2e98069c2c56ec93e1c65667a6
tree42642a862413608769a33aa3d5b6a7f51487029e
parentb3eb8fad4c9d5aa293e197bfff7039d6fa112a54
Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance

Kind equalities changed how `*`/`#` are represented internally, which
means that showing a `TypeRep` that contains either of those kinds
produces a rather gross-looking result, e.g.,

```
> typeOf (Proxy :: Proxy 'Just)
Proxy (TYPE 'Lifted -> Maybe (TYPE 'Lifted)) 'Just
```

We can at least special-case the `Show` instance for `TypeRep` so that
it prints `*` to represent `TYPE 'Lifted` and `#` to represent `TYPE
'Unlifted`.

Addresses one of the issues uncovered in #11334.

Test Plan: ./validate

Reviewers: simonpj, hvr, austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1757

GHC Trac Issues: #11334
libraries/base/Data/Typeable/Internal.hs
libraries/base/tests/T11334.hs [new file with mode: 0644]
libraries/base/tests/T11334.stdout [new file with mode: 0644]
libraries/base/tests/all.T