[GHC] #9761: A module can't usefully use both GeneralizedNewtypeDeriving and DeriveFoldable
GHC
ghc-devs at haskell.org
Mon Nov 3 16:31:08 UTC 2014
#9761: A module can't usefully use both GeneralizedNewtypeDeriving and
DeriveFoldable
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.9
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure: GHC
Blocked By: | rejects valid program
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
If GND is enabled, and roles don't permit a `Foldable` instance to be
derived, it won't fall back on `DeriveFoldable`; instead it just produces
an error. I think ideally I'd want to use a pragma to state explicitly
that I want to use `DeriveFoldable`-style deriving for this specific
instance, but an implicit fallback would be acceptable.
{{{#!hs
{-# LANGUAGE
-- GeneralizedNewtypeDeriving,
DeriveFoldable #-}
module Derive where
import qualified Data.IntMap as M
newtype UniqFM ele = UFM {unUFM :: M.IntMap ele}
deriving (Foldable)
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9761>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list