Cache TypeRep kinds aggressively
authorDavid Feuer <david.feuer@gmail.com>
Fri, 1 Dec 2017 22:00:24 +0000 (17:00 -0500)
committerDavid Feuer <David.Feuer@gmail.com>
Fri, 1 Dec 2017 22:00:25 +0000 (17:00 -0500)
commitbc761ad9c65c7aa62d38db39c59a6c0ae59c8ab8
tree434ced12dc70566760e61dbf6df5edfedf0fbb03
parent12efb230de40f24e4828734dd46627ebe24416b4
Cache TypeRep kinds aggressively

Cache `TypeRep k` in each `TrApp` or `TrTyCon` constructor of
`TypeRep (a :: k)`. This makes `typeRepKind` cheap.

With this change, we won't need any special effort to deserialize
typereps efficiently. The downside, of course, is that we make
`TypeRep`s slightly larger.

Reviewers: austin, hvr, bgamari, simonpj

Reviewed By: bgamari, simonpj

Subscribers: carter, simonpj, rwbarton, thomie

GHC Trac Issues: #14254

Differential Revision: https://phabricator.haskell.org/D4085
12 files changed:
compiler/deSugar/DsBinds.hs
compiler/prelude/PrelNames.hs
compiler/typecheck/TcTypeable.hs
libraries/base/Data/Typeable/Internal.hs
libraries/base/GHC/Show.hs
libraries/base/Type/Reflection/Unsafe.hs
testsuite/tests/ghci.debugger/scripts/break006.stderr
testsuite/tests/ghci.debugger/scripts/print019.stderr
testsuite/tests/indexed-types/should_fail/T12522a.stderr
testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr
testsuite/tests/typecheck/should_compile/holes2.stderr
testsuite/tests/typecheck/should_fail/tcfail133.stderr