Skip to content

Foldable cannot be derived by GND due to redundant contexts

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.

{-# LANGUAGE
--  GeneralizedNewtypeDeriving,
  DeriveFoldable #-}
module Derive where
import qualified Data.IntMap as M

newtype UniqFM ele = UFM {unUFM :: M.IntMap ele}
  deriving (Foldable)
Trac metadata
Trac field Value
Version 7.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited by David Feuer
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information