[GHC] #16146: Trivial partial type signature kills type inference in the presence of GADTs

GHC ghc-devs at haskell.org
Tue Jan 8 22:13:56 UTC 2019


#16146: Trivial partial type signature kills type inference in the presence of
GADTs
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                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 simonpj):

 How do you propose to do step 1 (check that `p` is a subtype of `t2`)?

 Suppose `p` is `forall a. _ -> a`, and `t2` is `Int -> Int`.

 Now when we instantiate `p` (to do the subtype check), what do we do about
 that `_`??  We could satisfy the subtype with `_` = `Int`, or `_` = `a`.

 The point is that we can't hope to instantiate a partial type signature,
 and we should not attempt to do so.  That's why I suggest that we might
 just squeeze by if there is visibly no quantification to be done.

 So I don't think comment:5 will work.

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


More information about the ghc-tickets mailing list