[GHC] #13154: Standalone-derived anyclass instances aren't as permissive as empty instances

GHC ghc-devs at haskell.org
Thu Feb 23 14:03:28 UTC 2017


#13154: Standalone-derived anyclass instances aren't as permissive as empty
instances
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  RyanGlScott
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:  Generics
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * milestone:   => 8.4.1


Comment:

 Another thing that standalone `DeriveAnyClass` currently doesn't allow
 (but bare instances do) is the use of nullary classes. That is, this is
 allowed:

 {{{#!hs
 {-# LANGUAGE MultiParamTypeClasses #-}
 module Allowed where

 class C
 instance C
 }}}

 but this is not:

 {{{#!hs
 {-# LANGUAGE DeriveAnyClass #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE StandaloneDeriving #-}
 module Bug where

 class C
 deriving instance C
 }}}

 {{{
 Bug.hs:7:1: error:
     ā€¢ Cannot derive instances for nullary classes
     ā€¢ In the stand-alone deriving instance for ā€˜Cā€™
 }}}

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


More information about the ghc-tickets mailing list