[GHC] #11616: Kinds aren't instantiated

GHC ghc-devs at haskell.org
Mon Feb 22 01:57:57 UTC 2016


#11616: Kinds aren't instantiated
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
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 goldfire):

 This is almost correct behavior. The only incorrect part of this is that
 visible type application is available on the kind argument to `whoami`
 even though the kind variable was not written in the declaration of
 `Whomami`. You hint at this weirdness at the end of your post, where the
 braces mean that a variable is not available for visible type application
 (because GHC inferred its presence and ordering). This is a known bug that
 I intend to fix.

 But everything else is OK. The problem is that visible type application
 should work on only type variables that are written by the user. (I have
 clarified this in unpushed edits to the manual.) When you say `whoami2 =
 whoami`, you're not giving a type signature to `whoami2`, and therefore
 usages of `whoami2` cannot use visible type application. This design
 decision was made to help keep usage of visible type application retain
 the same meaning as GHC's inference algorithm evolves. Without visible
 type application, `whoami2`'s type is indeed ambiguous and problematic.

 The problem is the same with `whoamiType`. And indeed, if you give a type
 signature, all is OK:

 {{{
 whoamiType :: forall a. Whoami (a :: Type) => String
 whoamiType = whoami @_ @a
 }}}

 I'm keeping this bug open to track the fix for the first issue, and as an
 interesting test case.

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


More information about the ghc-tickets mailing list