[GHC] #14203: GHC-inferred type signature doesn't actually typecheck

GHC ghc-devs at haskell.org
Fri Nov 3 08:38:17 UTC 2017


#14203: GHC-inferred type signature doesn't actually typecheck
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |             Keywords:  TypeInType,
      Resolution:                    |  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > But the point that I'm making (that no one has addressed yet) is that
 AllowAmbiguousTypes should allow GHC to accept such a definition!

 I don't agree.  It's the definition of `Foo` that has an ambiguous kind.
 ThE type signature for `bar` is entirely innocent. To see this more
 clearly try
 {{{
 bar :: forall a (z :: F a). Foo z -> Proxy z -> Int
 }}}
 Nothing ambiguous about that.  But simply kind-checking the type signature
 fails because `Foo`'s kind is ambiguous.

 > If we don't do this currently, then we should! There are many programs
 that I can't write because of this restriction. ]

 What is "this"?  Rejecting the definition of `Foo` (which would be the
 effect of checking `Foo`'s kind for ambiguity) would not typecheck more
 programs!

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


More information about the ghc-tickets mailing list