[GHC] #14060: TH-reified types can suffer from kind signature oversaturation

GHC ghc-devs at haskell.org
Tue Aug 15 01:35:28 UTC 2017


#14060: TH-reified types can suffer from kind signature oversaturation
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3807
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"ad7b945257ea262e3f6f46daa4ff3e451aeeae0b/ghc" ad7b945/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="ad7b945257ea262e3f6f46daa4ff3e451aeeae0b"
 Fix #14060 by more conservatively annotating TH-reified types

 Before, TH was quite generous in applying kind annotations to reified
 type constructors whose result kind happened to mention type variables.
 This could result in agonizingly large reified types, so this patch aims
 to quell this a bit by adopting a more nuanced algorithm for determining
 when a tycon application deserves a kind annotation.

 This implements the algorithm laid out in
 https://ghc.haskell.org/trac/ghc/ticket/14060#comment:1. I've updated
 `Note [Kind annotations on TyConApps]` to reflect the new wisdom.
 Essentially, instead of only checking if the result kind contains free
 variables, we also check if any of those variables do not appear free in
 injective positions in the argument kinds—only then do we put on a kind
 annotation.

 Bumps `haddock` submodule.

 Test Plan: make test TEST=T14060

 Reviewers: goldfire, austin, bgamari

 Reviewed By: goldfire

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #14060

 Differential Revision: https://phabricator.haskell.org/D3807
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14060#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list