[GHC] #14352: Higher-rank kind ascription oddities

GHC ghc-devs at haskell.org
Sat Oct 14 01:57:02 UTC 2017


#14352: Higher-rank kind ascription oddities
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
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):

 Looks good to me. It all comes down to this rule: GHC never infers a
 higher-rank kind. In your rejected example, you're asking GHC to infer a
 higher-rank kind for `x`. Now, you might say "but I'm telling you what the
 kind is!". The problem is that you haven't quite. You've said that `x` can
 be used at the type `forall b. b -> Int`, but its actual kind might be
 more general. On the other hand, when you give a kind at a binding site,
 that kind is authoritative -- no inference necessary.

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


More information about the ghc-tickets mailing list