[GHC] #10020: GHC 7.10 rejects nullary type class with associated data

GHC ghc-devs at haskell.org
Mon Jan 26 02:55:26 UTC 2015


#10020: GHC 7.10 rejects nullary type class with associated data
-------------------------------------+-------------------------------------
              Reporter:              |             Owner:
  RyanGlScott                        |            Status:  new
                  Type:  bug         |         Milestone:
              Priority:  normal      |           Version:  7.10.1-rc1
             Component:  Compiler    |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  GHC rejects
          Architecture:              |  valid program
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 In GHC 7.8.4, the following code is legal:

 {{{#!hs
 {-# LANGUAGE NullaryTypeClasses, TypeFamilies #-}
 module NullaryData where

 class NullaryClass where
     data NullaryData
 }}}

 In GHC 7.10, {{{NullaryTypeClasses}}} was
 [https://ghc.haskell.org/trac/ghc/ticket/8993 deprecated] in favor of
 {{{MultiParamTypeClasses}}}. However, running this code on GHC 7.10-rc1:

 {{{#!hs
 {-# LANGUAGE MultiParamTypeClasses, TypeFamilies #-}
 module NullaryData where

 class NullaryClass where
     data NullaryData
 }}}

 results in this error:

 {{{
 NullaryData.hs:4:1:
     The associated type ‘NullaryData’
     mentions none of the type or kind variables of the class
 ‘NullaryClass’
     In the class declaration for ‘NullaryClass’
 }}}

 It's probably related to [https://ghc.haskell.org/trac/ghc/ticket/9167
 this earlier bugfix].

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


More information about the ghc-tickets mailing list