[GHC] #16110: Explicit foralls in associated type family defaults are completely ignored?

GHC ghc-devs at haskell.org
Wed Jan 9 11:10:11 UTC 2019


#16110: Explicit foralls in associated type family defaults are completely ignored?
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.7
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Am I correct in believing that this change was part of implementing the
 [https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0007
 -instance-foralls.rst explicit foralls GHC proposal]?

 (Incidentally, this proposal is not listed as "implemented" in
 [https://github.com/ghc-proposals/ghc-
 proposals/pulls?page=2&q=label%3AAcceptedthe main list].  Should it be?)

 The proposal is silent on whether it applies to default family instance
 decls.  It'd be good to update the proposal to be clear on this point,
 since it is teh only specification we have.

 If the goal is to be able to explicitly bind every variable, would we need
 a forall for a default family instance?
 {{{
 class C a where
   type T a b :: *
   type T a b = (a, [b])
 }}
 Does the default instance need to replicate the type family signature?
 Eg can I say this?
 {{{
 class C a where
   type T a b :: *
   type T x y = (x, [y])
 }}}

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


More information about the ghc-tickets mailing list