[GHC] #12553: Reference kind in a type instance declaration defined in another instance declaration

GHC ghc-devs at haskell.org
Tue Aug 30 20:49:54 UTC 2016


#12553: Reference kind in a type instance declaration defined in another instance
declaration
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  TypeInType
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 simonpj):

 Richard says

 > but `Internal` looks OK to me. It should be accepted.

 Alas Jack has posted no fewer than four different declarations of
 `Internal`, so I'm not sure which one(s) you think should be accepted.

 Jack, what kind do you WANT `Internal` to have?  For example, in the one
 that works:
 {{{
 type family   Domain a :: Sig u -> Type
 type family   Internal (a :: Type) :: k
 }}}
 I believe we get
 {{{
 Domain :: forall (u :: Type). Type -> Sig u -> Type
 Internal :: forall (k :: Type). Type -> k
 }}}
 Now when writing them in associated form we have
 {{{
 class Syntactic a where
   type Domain   a :: Sig u -> Type
   type Internal a :: u
 }}}
 and this should not really be different.  I think it shoudl be accepted.
 But I do have a question: should we get
 {{{
       Domain :: Type -> forall u. Sig u -> Type
 or
       Domain :: forall u. Type -> Sig u -> Type
 }}}
 and does it matter at use sites?  Richard

 The same question arises with class methods.  Given
 {{{
 class C a where
   op :: forall b. Ord b => b -> a -> a
 }}}
 do we get
 {{{
    op :: forall a. C a => forall b. Ord b => b -> a -> a
 or
    op :: forall a b. (C a, Ord b) => b -> a -> a
 }}}
 Answer: wer get the former.

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


More information about the ghc-tickets mailing list