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

GHC ghc-devs at haskell.org
Wed Jan 9 15:39:01 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 RyanGlScott):

 I wonder: will we need to change some Template Haskell conventions to
 support this change? Currently, this:

 {{{#!hs
 [d| class C a where
       type T a
       type T a = a
   |]
 }}}

 Turns into this:

 {{{#!hs
 [ ClassD
     []
     C_6989586621679039759
     [ PlainTV a_6989586621679039761 ]
     []
     [ OpenTypeFamilyD
         (TypeFamilyHead
            T_6989586621679039760
            [ PlainTV a_6989586621679039761 ]
            NoSig
            Nothing)
     , TySynInstD
         (TySynEqn
            Nothing
            (AppT (ConT T_6989586621679039760) (VarT
 a_6989586621679039762))
            (VarT a_6989586621679039762))
     ]
 ]
 }}}

 Notice that we're using a `TySynInstD`/`TySynEqn` to represent the type
 family default, complete with a `Nothing` for its type variable binders.
 If we pursue the line of thought in this ticket, wouldn't that suggest
 that we should be using something else to represent this default?

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


More information about the ghc-tickets mailing list