summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Dataflow
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-14 19:46:45 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-17 20:04:08 -0400
commite45c85446de7589e17acf5654c2b33f766043eb1 (patch)
treedb36adba8d53eb3b9cc8e6cbfd37d43f7c8445b7 /compiler/GHC/Cmm/Dataflow
parentca48076ae866665913b9c81cbc0c76f0afef7a00 (diff)
downloadhaskell-e45c85446de7589e17acf5654c2b33f766043eb1.tar.gz
Generalize OutputableP
Add a type parameter for the environment required by OutputableP. It avoids tying Platform with OutputableP.
Diffstat (limited to 'compiler/GHC/Cmm/Dataflow')
-rw-r--r--compiler/GHC/Cmm/Dataflow/Label.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/GHC/Cmm/Dataflow/Label.hs b/compiler/GHC/Cmm/Dataflow/Label.hs
index e01f301627..148fc15ede 100644
--- a/compiler/GHC/Cmm/Dataflow/Label.hs
+++ b/compiler/GHC/Cmm/Dataflow/Label.hs
@@ -3,6 +3,9 @@
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances #-}
+
module GHC.Cmm.Dataflow.Label
( Label
@@ -43,7 +46,7 @@ instance Uniquable Label where
instance Outputable Label where
ppr label = ppr (getUnique label)
-instance OutputableP Label where
+instance OutputableP env Label where
pdoc _ l = ppr l
-----------------------------------------------------------------------------
@@ -131,8 +134,8 @@ instance Outputable LabelSet where
instance Outputable a => Outputable (LabelMap a) where
ppr = ppr . mapToList
-instance OutputableP a => OutputableP (LabelMap a) where
- pdoc platform = pdoc platform . mapToList
+instance OutputableP env a => OutputableP env (LabelMap a) where
+ pdoc env = pdoc env . mapToList
instance TrieMap LabelMap where
type Key LabelMap = Label