[GHC] #12569: TypeApplications allows instantiation of implicitly-quantified kind variables

GHC ghc-devs at haskell.org
Tue Sep 6 16:06:12 UTC 2016


#12569: TypeApplications allows instantiation of implicitly-quantified kind
variables
-------------------------------------+-------------------------------------
        Reporter:  vagarenko         |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |             Keywords:
      Resolution:                    |  TypeApplications
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 adamgundry):

 Ah, I imagined that the left-to-right collection and topological sorting
 of variables applied only when there wasn't an explicit `forall`. My
 expectation was that if the user gives an explicit `forall`, only the
 binding occurrences would be available for visible type application. Thus
 `forall (x :: k)` would make `x` available alone, whereas `forall k (x ::
 k)` would make both `k` and `x` available.

 I think this alternative would be better, because otherwise there is no
 way to get at `forall {k} (x :: k)`, is there? Unless we permit visibility
 annotations in concrete syntax, I suppose...

 In any case, this deserves explicit mention in the manual, including the
 `forall (x :: k)` example, whichever treatment it ends up getting.

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


More information about the ghc-tickets mailing list