summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorDavid Feuer <David.Feuer@gmail.com>2014-11-05 08:42:59 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2014-11-05 08:54:44 +0100
commit0a8e8995fd31dd46fa9bdbc7f65984b51c8c13dc (patch)
tree7825083b19768f3317470f1ec520f0c2e431e0de /compiler
parent77f8221103a98b38384edd8c2caae6cc2c4ffd72 (diff)
downloadhaskell-0a8e8995fd31dd46fa9bdbc7f65984b51c8c13dc.tar.gz
Remove redundant contexts from Foldable methods
New `Foldable` methods accidentally had `Foldable` contexts, which led to type roles being assigned incorrectly and preventing GND from deriving `Foldable` instances. Removing those fixes #9761. Moreover, this patch takes advantage of this fix by deriving `Foldable` (and `Eq`) for `UniqFM`. Differential Revision: https://phabricator.haskell.org/D425
Diffstat (limited to 'compiler')
-rw-r--r--compiler/utils/UniqFM.lhs20
1 files changed, 3 insertions, 17 deletions
diff --git a/compiler/utils/UniqFM.lhs b/compiler/utils/UniqFM.lhs
index 3ea97e467c..f0f903522b 100644
--- a/compiler/utils/UniqFM.lhs
+++ b/compiler/utils/UniqFM.lhs
@@ -72,7 +72,6 @@ import Outputable
import Compiler.Hoopl hiding (Unique)
-import Data.Function (on)
import qualified Data.IntMap as M
import qualified Data.IntSet as S
import qualified Data.Foldable as Foldable
@@ -212,22 +211,9 @@ instance Monoid (UniqFM a) where
%************************************************************************
\begin{code}
-newtype UniqFM ele = UFM { unUFM :: M.IntMap ele }
- deriving (Typeable,Data, Traversable.Traversable, Functor)
-
-instance Eq ele => Eq (UniqFM ele) where
- (==) = (==) `on` unUFM
-
-{-
-instance Functor UniqFM where
- fmap f = fmap f . unUFM
-
-instance Traversable.Traversable UniqFM where
- traverse f = Traversable.traverse f . unUFM
--}
-
-instance Foldable.Foldable UniqFM where
- foldMap f = Foldable.foldMap f . unUFM
+newtype UniqFM ele = UFM (M.IntMap ele)
+ deriving (Data, Eq, Foldable.Foldable, Functor, Traversable.Traversable,
+ Typeable)
emptyUFM = UFM M.empty
isNullUFM (UFM m) = M.null m