[GHC] #16344: GHC infers over-polymorphic kinds

GHC ghc-devs at haskell.org
Sun Mar 10 14:31:16 UTC 2019


#16344: GHC infers over-polymorphic kinds
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Marge Bot <ben+marge-bot@…>):

 In [changeset:"1f5cc9dc8aeeafa439d6d12c3c4565ada524b926/ghc" 1f5cc9d/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="1f5cc9dc8aeeafa439d6d12c3c4565ada524b926"
 Stop inferring over-polymorphic kinds

 Before this patch GHC was trying to be too clever
 (Trac #16344); it succeeded in kind-checking this
 polymorphic-recursive declaration

     data T ka (a::ka) b
       = MkT (T Type           Int   Bool)
             (T (Type -> Type) Maybe Bool)

 As Note [No polymorphic recursion] discusses, the "solution" was
 horribly fragile.  So this patch deletes the key lines in
 TcHsType, and a wodge of supporting stuff in the renamer.

 There were two regressions, both the same: a closed type family
 decl like this (T12785b) does not have a CUSK:
   type family Payload (n :: Peano) (s :: HTree n x) where
     Payload Z (Point a) = a
     Payload (S n) (a `Branch` stru) = a

 To kind-check the equations we need a dependent kind for
 Payload, and we don't get that any more.  Solution: make it
 a CUSK by giving the result kind -- probably a good thing anyway.

 The other case (T12442) was very similar: a close type family
 declaration without a CUSK.
 }}}

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


More information about the ghc-tickets mailing list