[GHC] #13742: Code using ConstraintKinds needs explicit kind signature with GHC 8.2.1

GHC ghc-devs at haskell.org
Tue May 23 13:18:10 UTC 2017


#13742: Code using ConstraintKinds needs explicit kind signature with GHC 8.2.1
-------------------------------------+-------------------------------------
        Reporter:  albertov          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.1-rc2
  checker)                           |             Keywords:
      Resolution:                    |  ConstraintKinds, KindSignatures
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 goldfire):

 GHC does a very limited form of type-directed name resolution to tell the
 difference between `(,) :: Type -> Type -> Type` and `(,) :: Constraint ->
 Constraint -> Constraint`. Type-directed name resolution and type
 inference hate each other with a passion, so sometimes there's collateral
 damage in the fight.

 Bottom line: this design is an infelicity of `ConstraintKinds` in GHC. A
 fix would be to parameterize `(,)` by a `Constraintiness` parameter, as
 discussed [https://github.com/ghc-proposals/ghc-proposals/pull/32 here].
 Then type inference would be predictable. Short of that solution, I'm not
 sure what guarantees we can promise.

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


More information about the ghc-tickets mailing list