[GHC] #12468: GADTs don't refine hole types

GHC ghc-devs at haskell.org
Wed Aug 10 22:43:48 UTC 2016


#12468: GADTs don't refine hole types
-------------------------------------+-------------------------------------
        Reporter:  benjamin.hodgson  |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  MacOS X           |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I don't think this is a bug.  Yes we have an equality in scope; but a
 value of type `a` and one of type `Int` are both equally valid things to
 fill the hole with.  E.g.
 {{{
 f :: T a -> a -> a
 f I x = _
 }}}
 I could fill the hole with `(3::Int)` or with `x`.  Neitehr is better than
 the other.

 Another way to say this is that type equalities are not normalising; they
 are equalities, not left-to-right rewrite rules.   Suppose we had `a ~ b`
 in scope.  Should report the hole as having type `a` or `b`?  What if it
 was `a ~ [b]`?

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


More information about the ghc-tickets mailing list